在使用本地主机发送邮件时需要帮助 [英] Need help in sending mail using local host

查看:82
本文介绍了在使用本地主机发送邮件时需要帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码

This is my code

<?php

$to  = 'xyz@hotmail.com';

$subject = 'checking mail';

$message = '
<html>
<body>
  <p>mail sent :)!</p>
</body>
</html>
';



$headers  = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";



mail($to, $subject, $message, $headers);

?>




我收到此错误




and i am getting this error

报价:

警告:mail()[function.mail]:无法通过"localhost"端口25连接到邮件服务器,请验证您的"SMTP"和php.ini中的"smtp_port"设置,或在第45行的C:\ wamp \ www \ demo.php中使用ini_set()

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\demo.php on line 45

推荐答案

=' xyz@hotmail.com' ;
to = 'xyz@hotmail.com';


主题 检查邮件'
subject = 'checking mail';


消息 < html> <身体> < p>邮件已发送:)!</p> </body> </html> '
message = ' <html> <body> <p>mail sent :)!</p> </body> </html> ';


这篇关于在使用本地主机发送邮件时需要帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆