>  기사  >  백엔드 개발  >  关于用phpmailer 发邮件的有关问题

关于用phpmailer 发邮件的有关问题

WBOY
WBOY원래의
2016-06-13 10:05:34955검색

关于用phpmailer 发邮件的问题
小弟刚接触php不久,试着想用phpmailer   发送邮件,但是得到了以下的error   message..   The   following   From   address   failed:   [email protected]    

以下是代码,本人学习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   =   "[email protected] ";
$mail-> AddAddress( "[email protected] ");

$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: [email protected]

没有这个EMAIL地址嘛

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.