我尝试使用php和Zend_Mail从我们的服务器发送电子邮件。我用smtp传输。这是订阅的混乱电子邮件。但由于某种原因,我发送的电子邮件有奇怪的标题,电子邮件发送到垃圾邮件文件夹(我在收到信件的gmail中看到它们):
Message-Id: <50ee94f7.84fc440a.62dc.ffff9685SMTPIN_ADDED_MISSING@mx.google.com>
Received: (qmail 10943 invoked from network); 10 Jan 2013 10:16:22 -0000
Received: from unknown (HELO searchboxindustries.com) (username@searchboxindustries.com@207.162.215.30)
列表标题“收到:来自未知”是什么意思?可以让电子邮件发送到垃圾邮件吗?如何避免这个奇怪的标题并使电子邮件避免垃圾邮件文件夹coode有什么问题,或者我对这个域的DNS设置有问题吗?
以下是设置标题的代码:
$mailer->setFrom($params['list_email'], $params['list_from_name']);
$mailer->setReplyTo($params['list_email']);
$mailer->addHeader('Sender', $params['list_email'] . '.searchboxindustries.com');
$mailer->setReturnPath($params['list_email'] . '.searchboxindustries.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 = searchboxindustries.com
email.server = searchboxindustries.com
email.username = user_name
email.password = password
email.auth = plain
email.port = 587
以下是此类电子邮件的标题:
Delivered-To: gala19612009@gmail.com
Received: by 10.76.94.204 with SMTP id de12csp111150oab;
Fri, 11 Jan 2013 01:58:49 -0800 (PST)
X-Received: by 10.69.0.8 with SMTP id au8mr228881813pbd.58.1357898329423;
Fri, 11 Jan 2013 01:58:49 -0800 (PST)
Return-Path: <opp@mail15.com.searchboxindustries.com>
Received: from smtp1-1.searchboxindustries.com (mta1.searchboxindustries.com. [207.162.215.30])
by mx.google.com with SMTP id d7si4727205paw.95.2013.01.11.01.58.48;
Fri, 11 Jan 2013 01:58:48 -0800 (PST)
Received-SPF: pass (google.com: domain of opp@mail15.com.searchboxindustries.com designates 207.162.215.30 as permitted sender) client-ip=207.162.215.30;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of opp@mail15.com.searchboxindustries.com designates 207.162.215.30 as permitted sender) smtp.mail=opp@mail15.com.searchboxindustries.com
Message-Id: <50efe258.a74b420a.3351.12fcSMTPIN_ADDED_MISSING@mx.google.com>
Received: (qmail 21583 invoked from network); 11 Jan 2013 09:58:48 -0000
Received: from unknown (HELO searchboxindustries.com) (username@searchboxindustries.com@207.162.215.30)
by searchboxindustries.com with SMTP; 11 Jan 2013 09:58:48 -0000
From: Oleg <opp@mail15.com>
Reply-To: opp@mail15.com
Sender: opp@mail15.com.searchboxindustries.com
Return-Path: opp@mail15.com.searchboxindustries.com
To: gala19612009@gmail.com
Subject: List1: Confirm Subscription
Date: Fri, 11 Jan 2013 04:58:48 -0500
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
MIME-Version: 1.0
Spf似乎没问题。 发送电子邮件的IP未列入黑名单。
现在DNS有变化,我有标题:
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
我们有反向DNS设置。 207.162.215.30已解析为stmp1.searchboxindustries.com。那有什么问题呢?我想知道标题中括号中的奇怪格式是什么:来自未知:
username@searchboxindustries.com@207.162.215.30
答案 0 :(得分:1)
Received: from unknown
只是意味着一个SMTP服务器从另一个不提供反向DNS的SMTP服务器接收它。通常,从一个SMTP服务器到另一个SMTP服务器的每个跃点在消息顶部添加一个Received:
标头(qmail
除外,后者添加两个;这在您的示例中可见)。
如果您担心缺少反向DNS,并且207.162.215.30是您的,那么也许您可以说服您的ISP为其提供反向DNS。许多ISP拒绝(如果您使用的是“消费者”宽带计划),或者需要与您签订不同的托管合同才能提供此服务。 (“反向DNS”表示当有人向DNS查询“DNS名称207.162.215.30”时,答案将是“searchboxindustries.com”或者可能是其他主机名,但不是“未知”。)
反向DNS查找通常基于TCP标头执行,而不是根据消息文本执行。如果SMTP服务器从123.45.67.89收到连接,则它将为该地址执行反向DNS,并将结果放入它添加的Received:
标头中。换句话说,邮件标题或信封标题的内容根本不会影响此结果。
收件人可以使用这些标头做任何他们想做的事情。单独使用此标头(此标头的存在,或者没有反向DNS信息从其中显而易见)对于某人将您的邮件归类为垃圾邮件是不够的,但实际上没有办法控制收件人使用此信息。
如果有的话,您的问题表明您可能应该寻求专业服务代表您发送这些消息,但需要付费。
答案 1 :(得分:0)
尝试以下选项以查找问题所在:
答案 2 :(得分:0)
我的服务器需要额外的(php。)ini设置,可能会解决您的问题吗?
ini_set('sendmail_from', 'enterAValidEmailAddr@yourDomainHere');