使用 Symfony Mailer 对象发送的电子邮件会进入垃圾邮件文件夹

发布于 2024-10-17 14:52:21 字数 1234 浏览 6 评论 0原文

我使用 Symfony 1.4.8 和 Propel 作为 ORL。我正在使用 Symfony miler 对象发送邮件,邮件发送正确,但它进入垃圾邮件文件夹,有什么方法可以阻止这种情况。我正在使用的代码,

$to_email_array=array("[email protected]","[email protected]");
$body="welcome to symfony";
$subject="from Symfony";
$from=array('[email protected]' => 'our Domain');
$mail_object=$this->getMailer();
$message=Swift_Message::newInstance()
                                 ->setSubject($subject)
                                 ->setBody("<html> <head> </head> <body> <span>Dear {receiver}, </span>".$body."</body> </html>", "text/html")
                                 ->setFrom($from)
                                 ->setTo($to_email_array);
$mailed=$mail_object->batchSend($message);

上面的代码是从 Symfony 任务调用的,我们正在使用我们自己的 Web 服务器使用我们的域名发送邮件。邮件已发送,但进入垃圾邮件文件夹。有什么办法可以阻止邮件进入垃圾邮件文件夹。

I am using Symfony 1.4.8 and Propel as ORL. I am sending mails using Symfony miler object, the mail is send properly but it goes to spam folder, is there any way to stop that. the code that i am using,

$to_email_array=array("[email protected]","[email protected]");
$body="welcome to symfony";
$subject="from Symfony";
$from=array('[email protected]' => 'our Domain');
$mail_object=$this->getMailer();
$message=Swift_Message::newInstance()
                                 ->setSubject($subject)
                                 ->setBody("<html> <head> </head> <body> <span>Dear {receiver}, </span>".$body."</body> </html>", "text/html")
                                 ->setFrom($from)
                                 ->setTo($to_email_array);
$mailed=$mail_object->batchSend($message);

The above code is called from a Symfony Task, and we are using our own web server to send mail, with our domain name. The mail is send, but it goes to spam folder. Is there any way to stop the mail going to spam folder.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

浪漫人生路 2024-10-24 14:52:21

垃圾邮件过滤可以基于基础设施问题,也可以基于消息内容。您需要告诉我们有关您的设置的更多信息,或者尝试一些操作来找出问题所在:

  1. 您的网络服务器是否有唯一的 IP,并且您的网络服务器是否设置了反向 DNS IP?

  2. 您在 DNS 中是否有 SPF 记录,指定您的网络服务器有权为您的域发送电子邮件?如果您不确定我的意思,您可以阅读以下内容: http://www.open- spf.org/Tools/

  3. 哪些电子邮件服务或客户端正在垃圾邮件/退回电子邮件?是否添加了消息标头来指示匹配了哪些过滤规则?

Spam filtering can be either based on infrastructure problems, or on message content. You will need to tell us more about your setup, or try a few things, to work out where the problem is:

  1. Do you have a unique IP for your web server, and you have reverse DNS set up for your web server IP?

  2. Do you have a SPF record in DNS designating your web server as authorized to send email for your domain? If you're not sure what I mean, you can read this: http://www.open-spf.org/Tools/

  3. Which email service(s) or client(s) are junking/bouncing the emails? Are there any added message headers indicating what filter rules were matched?

心奴独伤 2024-10-24 14:52:21

您需要设置DKIMSPF,这可以轻松完成观看此视频。这些将允许其他网站验证电子邮件是否确实来自您并且可以信任。

You need to setup DKIM and SPF which can be done easily by watching this video. Those will allow other sites to verify emails actually came from you and can be trusted.

暗藏城府 2024-10-24 14:52:21

我通常发现对我有用的是以 RFC822 格式指定所有地址(收件人、发件人、抄送等),如下所示:

收件人:“John Doe”[电子邮件受保护]> ;

What I generally find to work for me is to specify all addresseses (To, From, Cc, etc) in RFC822 format, like so:

To: "John Doe" <[email protected]>

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文