使用Gmail SMTP服务器通过PHPMailer发送电子邮件我想用Gmail SMTP服务器通过PHP Mailer.这是我的密码<?php
require_once('class.phpmailer.php');$mail = new PHPMailer();$mail->IsSMTP();$mail->CharSet="UTF-8";$mail->SMTPSecure = 'tls';
$mail->Host = 'smtp.gmail.com';$mail->Port = 587;$mail->Username = 'MyUsername@gmail.com';$mail->Password = 'valid password';
$mail->SMTPAuth = true;$mail->From = 'MyUsername@gmail.com';$mail->FromName = 'Mohammad Masoudian';
$mail->AddAddress('anotherValidGmail@gmail.com');$mail->AddReplyTo('phoenixd110@gmail.com', 'Information');
$mail->IsHTML(true);$mail->Subject = "PHPMailer Test Subject via Sendmail, basic";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";$mail->Body = "Hello";if(!$mail->Send()){
echo "Mailer Error: " . $mail->ErrorInfo;}else{
echo "Message sent!";}?>但我收到以下错误Mailer Error: SMTP Error: The following recipients failed: anotherValidGmail@gmail.com
SMTP server error: SMTP AUTH is required for message submission on port 587我的域名是瓦坦设计
3 回答
- 3 回答
- 0 关注
- 1473 浏览
添加回答
举报
0/150
提交
取消