PHPMailer发送电子邮件警告:此消息可能未被发送:foo@gmail.com了解更多报告钓鱼 [英] PHPMailer sending e-mails with the warning: This message may not have been sent by: foo@gmail.com Learn more Report phishing

查看:1721
本文介绍了PHPMailer发送电子邮件警告:此消息可能未被发送:foo@gmail.com了解更多报告钓鱼的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PHPMailer从我的网站发送自动化电子邮件,而在测试时,我注意到php邮件发送的所有电子邮件正在收件人端发送以下警告:

I am using PHPMailer to send automated e-mails from my website and while testing, I noticed that all e-mails sent by php mailer are generating the following warning on the recipients end:

此消息可能未被发送:foo@gmail.com了解更多报告钓鱼

This message may not have been sent by: foo@gmail.com Learn more Report phishing

我想知道是否有办法避免这种情况?

I was wondering if there is a way to avoid this?

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 ...

I am using GMail and I have SMTP enabled...

推荐答案

您可以为您的网站设置Google应用,并获取一个Username@yourwebsite.com Gmail帐户(更多信息,这里是免费的),或者您将需要在当前的服务器上设置一个Email@yourwebsite.com的电子邮件地址,并将其用作$ mail-> from address。

You can either set up google apps for your site and get a Username@yourwebsite.com gmail account (more info here it's free), or You will need to set up an e-mail address on your current server that is Username@yourwebsite.com and use that as the $mail->from address.

您的电子邮件收件人正在收到邮件,因为您正在通知Google从您的服务器发送电子邮件,然后您正在告诉他们邮件来自gmail,而不是,它来自您的个人服务器。由于从地址和服务器地址不匹配,它们将其标记为垃圾邮件。这是谷歌防止垃圾邮件的方法,对于他们来说,如果您从(YOURMOM@LOL.com)中输入$ mail->则将是一样的。电子邮件仍然会发送,但您的域名与@地址不匹配。

Your E-Mail recipients are receiving the message because you are telling google to send an e-mail from your server, and then you are telling them that the mail is coming from gmail, which it isn't, it's coming from your personal server. Since the from address and your server address don't match, they flag it as spam. This is googles way of preventing spam, to them it would be the same if you put $mail->from(YOURMOM@LOL.com). The e-mail would still send, but your domain name does not match the @ address.

这篇关于PHPMailer发送电子邮件警告:此消息可能未被发送:foo@gmail.com了解更多报告钓鱼的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆