我尝试使用 php 和 Zend_Mail 从我们的服务器发送电子邮件。我使用 smtp 传输。这是在我的网站上订阅的确认电子邮件。但由于某种原因,我发送的电子邮件有奇怪的标题,并且电子邮件进入垃圾邮件文件夹:
Message-Id: <50f41c80.67e3440a.2d32.6aabSMTPIN_ADDED_MISSING@mx.google.com>
Received: (qmail 18457 invoked from network); 14 Jan 2013 14:55:59 -0000
Received: from unknown (HELO smtp1-1.searchboxindustries.com) (username@searchboxindustries.com@207.162.215.30)
by searchboxindustries.com with SMTP; 14 Jan 2013 14:55:59 -0000
smtp1.searchboxindustries.com 应解析为 207.162.215.30。那为什么我有这个标题?
列表标题“已收到:来自 uknown”是什么意思?它可以使电子邮件成为垃圾邮件吗?如何避免这个奇怪的标题并使电子邮件避免垃圾邮件文件夹?也许我对这个域的 DNS 设置有一些问题?
Spf 似乎还可以:
Received-SPF: pass
设置标题的代码:
$mailer->clearFrom();
$mailer->setFrom($params['list_email'], $params['list_from_name']);
$mailer->setReplyTo($params['list_email']);
$mailer->addHeader('Sender', $params['list_email'] . '.emailname.com');
$mailer->setReturnPath($params['list_email'] . '.emailname.com');
$mailer->addTo($params['email_address']);
配置传输的代码:
$emailConfig = $this->getOption('email');
$transport = new Zend_Mail_Transport_Smtp($emailConfig['server'], $emailConfig);
Zend_Mail::setDefaultTransport($transport);
来自 application.ini 的电子邮件配置:
email.name = emailname.com
email.server = emailserver.com
email.username = email@address.com
email.password = password
email.auth = plain
email.port = 999
email.from_address = "address@email.com"
email.from_name = "Mailable";