我有以下系统设置
> Windows XP Service Pack 2
> WAMP 2.0
> PHP 5.3
smtp=smtp.gmail.com
smtp_port=25;
<?PHP
mail('alagar.pandi@gmail.com','test subject','test body');
?>
我得到的错误是
Warning: mail() [function.mail]: SMTP server response:
530 5.7.0 Must issue a STARTTLS command first.
4sm389277yxd.16 in C:\wamp\www\limosbusesjets\test.PHP on line 5
有什么建议?
解决方法:
我一直使用PHPMailer来满足我的所有邮件需求.
它已经内置支持GMail作为服务器(并且它是免费的)
我认为您的问题是您尝试使用PHP的邮件设置而不是PHPMailer
确保您具有以下设置:
$mail = new PHPMailer(); //Setup the mailer
$mail->IsSMTP();
//$mail->SMTPDebug = 2;
$mail->SMTPAuth = true; //enable SMTP authentication
$mail->SMTPSecure = "ssl"; //sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; //sets GMAIL as the SMTP server
$mail->Port = 465; //set the SMTP port
$mail->Username = $guser; //GMAIL username
$mail->Password = $gpwd; //GMAIL password
$mail->AddReplyTo($fromAddress,$fromName);
$mail->From = $guser;
$mail->FromName = "Your name";
$mail->Subject = $subject; //E-Mail subject
$mail->AltBody = $bodyAlt; //Text Body
$mail->WordWrap = 50; //set word wrap
$mail->Priority = $priority; //Mail priority
$mail->MsgHTML($ebody);
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。