我正在使用 PHPMailer 从我的网站发送自动电子邮件,在测试时,我注意到 php mailer 发送的所有电子邮件都在收件人端生成以下警告:
此邮件的发送者可能不是:foo@gmail.com 了解更多 报告网络钓鱼
我想知道是否有办法避免这种情况?
PHP邮件程序代码:
//mail functions
require("mailer/class.phpmailer.php");
require("mailer/class.smtp.php");
require("mailer/class.pop3.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "relay-hosting.secureserver.net";
$mail->Port = 25;
$mail->IsHTML(true);
$mail->Username = "foo@gmail.com"; // SMTP username
$mail->Password = "pass"; // SMTP password
$mail->From = "foo@gmail.com";
$mail->FromName = "FOO";
$mail->AddAddress("fOO@gmail.com", "WIDB");
$mail->AddReplyTo("foo@gmail.com");
//$mail->AddAddress("foo@gmail.com"); // name is optional
$mail->WordWrap = 50; // set word wrap to 50 characters
//$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments
//$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name
$mail->IsHTML(true); // set email format to HTML
$mail->Subject = 'Foo - Transaction Receipt';
$mail->Body = $message;
$mail->AltBody = "nothing";
//send mail
$mail->Send();
我正在使用 GMail 并且启用了 SMTP...