Zend_Mail 发送的电子邮件被视为垃圾邮件
请告诉我我做错了什么。我正在使用 Zend_Mail 类发送电子邮件,如下所示:
$message = <<<STR
You have a new invoice!
Sign in to your clientarea to see it.
Best regards,
Company name
STR;
$mail = new Zend_Mail();
$mail->setBodyText($message);
$mail->setFrom('[email protected]', 'Company.com');
$mail->addTo('[email protected]', 'Client Name');
$mail->setSubject('You have a new invoice!');
$mail->send();
但它被作为垃圾邮件接收。我的服务器上还有其他应用程序,例如 Webmin,它们发送的电子邮件不会被视为垃圾邮件。
Please tell me what I am doing wrong. I am sending an email using the Zend_Mail class like this:
$message = <<<STR
You have a new invoice!
Sign in to your clientarea to see it.
Best regards,
Company name
STR;
$mail = new Zend_Mail();
$mail->setBodyText($message);
$mail->setFrom('[email protected]', 'Company.com');
$mail->addTo('[email protected]', 'Client Name');
$mail->setSubject('You have a new invoice!');
$mail->send();
It is received as a spam though. There are other applications such as Webmin on my server and emails they send is not treated as SPAM.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过添加这些行解决了这个问题:
关键行似乎是添加 Reply-To 标头。如果没有它,它总是会进入垃圾邮件。一旦我设置了回复标题,电子邮件客户端就不再将其视为垃圾邮件。
I have solved this by adding these lines:
The critical line seems to be adding Reply-To header. Without that it would always go to SPAM. Once I set the Reply-To header email clients stopped treating it as spam.