关于用phpmailer 发邮件的有关问题
程序员文章站
2022-05-29 16:30:55
...
关于用phpmailer 发邮件的问题
小弟刚接触php不久,试着想用phpmailer 发送邮件,但是得到了以下的error message.. The following From address failed: example@163.com
以下是代码,本人学习php时间不长,所以水平不高,希望各位高手能多多帮忙,谢谢大家
require( "class.phpmailer.php ");
$mail = new PHPMailer();
$mail-> IsSMTP(); // telling the class to use SMTP
$mail-> Host = "smtp.163.com "; // SMTP server
$mail-> SetLanguage( "en ", "./phpmailer/language/ ");
$mail-> From = "example@163.com ";
$mail-> AddAddress( "123123123@hotmail.com ");
$mail-> Subject = "First PHPMailer Message ";
$mail-> Body = "Hi! \n\n This is my first e-mail sent through PHPMailer. ";
$mail-> WordWrap = 50;
if(!$mail-> Send())
{
echo 'Message was not sent. ';
echo 'Mailer error: ' . $mail-> ErrorInfo;
}
else
{
echo 'Message has been sent. ';
}
?>
------解决方案--------------------
error message.. The following From address failed: example@163.com
没有这个EMAIL地址嘛
小弟刚接触php不久,试着想用phpmailer 发送邮件,但是得到了以下的error message.. The following From address failed: example@163.com
以下是代码,本人学习php时间不长,所以水平不高,希望各位高手能多多帮忙,谢谢大家
require( "class.phpmailer.php ");
$mail = new PHPMailer();
$mail-> IsSMTP(); // telling the class to use SMTP
$mail-> Host = "smtp.163.com "; // SMTP server
$mail-> SetLanguage( "en ", "./phpmailer/language/ ");
$mail-> From = "example@163.com ";
$mail-> AddAddress( "123123123@hotmail.com ");
$mail-> Subject = "First PHPMailer Message ";
$mail-> Body = "Hi! \n\n This is my first e-mail sent through PHPMailer. ";
$mail-> WordWrap = 50;
if(!$mail-> Send())
{
echo 'Message was not sent. ';
echo 'Mailer error: ' . $mail-> ErrorInfo;
}
else
{
echo 'Message has been sent. ';
}
?>
------解决方案--------------------
error message.. The following From address failed: example@163.com
没有这个EMAIL地址嘛
相关文章
相关视频
上一篇: 用PHP工具包expat解析XML
下一篇: thinkphp实现上一篇与下一篇的方法