gpt4 book ai didi

php - 如何避免收到电子邮件 header : from unknown and email going to spam

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:48:08 41 4
gpt4 key购买 nike

我尝试使用 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 发生了变化,我有了 header :

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。那有什么问题呢?我想知道 header 中括号中的奇怪格式是什么 Received : from unknow:

 username@searchboxindustries.com@207.162.215.30

最佳答案

Received: from unknown 只是意味着一个 SMTP 服务器从另一个不提供反向 DNS 的服务器接收它。通常,从一个 SMTP 服务器到另一个服务器的每个跃点都会在邮件顶部添加一个 Received: header (qmail 除外,它添加两个;这在您的示例中可见)。

如果您担心缺少反向 DNS,并且 207.162.215.30 是您的,那么也许您可以说服您的 ISP 为其提供反向 DNS。许多 ISP 拒绝(如果您使用的是“消费者”宽带计划),或者需要与您签订不同的托管契约(Contract)才能提供此服务。 (“反向 DNS”意味着当有人向 DNS 查询“207.162.215.30 的 DNS 名称是什么”时,答案将是“searchboxindustries.com”或可能是另一个主机名,但不是“未知”。)

反向 DNS 查找通常基于 TCP header 而不是消息文本执行。如果 SMTP 服务器接收到来自 123.45.67.89 的连接,那么它将对该地址执行反向 DNS,并将结果放入它添加的 Received: header 中。换句话说,您的邮件 header 或信封 header 的内容根本不会影响此结果。

收件人可以使用这些 header 做任何他们想做的事情。仅此 header (此 header 的存在,或从其内容中可以明显看出反向 DNS 信息的缺失)不太可能足以让某人将您的邮件归类为垃圾邮件,但实际上没有办法控制收件人会处理此信息。

如果有的话,您的问题表明您或许应该寻找专业服务来代表您发送这些消息,但需要付费。

关于php - 如何避免收到电子邮件 header : from unknown and email going to spam,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14273582/

41 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com