绕过 Gmail 的垃圾邮件过滤器(使用 PHP 从共享主机发送的邮件)编辑:
TL;DR:从共享主机发送的邮件(例如来自Unoeuro或 One.com 的廉价域名)最终成为垃圾邮件。如何修复?
我做了一个邮件系统,首先生成一个PDF文件(使用FPDF),然后它用PHP的Swiftmailer将PDF文件作为附件发送。这封电子邮件已发送给130人(作为“one-of”发票)。但它几乎落入了每个人的垃圾邮件过滤器。我尝试调整 SwiftMailers 标头设置,但没有运气。甚至是我以前没有发送过的邮件(经过全面测试)。这是我的初始设置:
function sendMailEt($toEmail, $toName, $invoiceNumber){
require_once('includes/lib/swift_required.php');
$transport = Swift_SmtpTransport::newInstance('mailout.one.com', 25)
->setUsername('EMAIL-ACCOUNT1@THE-DOMAIN.DK')
->setPassword('THE-PASSWORD')
;
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance('FROM COMPANY')
->setSubject('Thanks for signing up - COMPANY')
->setFrom(array('EMAIL-ACCOUNT1@THE-DOMAIN.DK' => 'Company name'))
->setTo(array($toEmail => $toName))
->setBody('A brief body, that explains that this is an invoice and that it has to be paid within 5 days. (written in danish)')
->addPart('A brief body, that explains that this is an invoice and that it has to be paid within 5 days. (written in danish)', 'text/html')
->attach(Swift_Attachment::fromPath('/URL-TO-THE-PDF-FILE.pdf'))
;
$result = $mailer->send($message);
}
我还尝试使用PHP的本机-函数发送电子邮件,然后简单地链接到发票( )...相同的结果(垃圾邮件)。mail()
http://www.company-domain-name.dk/invoice/base64_encoded-name.pdf
我试着自己写整个标题。我读过很多关于标题应该包含哪些内容的论坛,但它们都写了不同的东西。所以我尝试了几种不同的方法(我以前发送的电子邮件和我没有发送的电子邮件)......相同的结果(垃圾邮件)。
然后,我尝试像MailChimps一样在他们的标题中编写标题。这让我想到了这一点:
$headers = "Reply-To: Company name <UNUSED-EMAIL-ACCOUNT-FROM-DOMAIN@DOMAIN-NAME.DK>\r\n";
$headers .= "Return-Path: Company name <UNUSED-EMAIL-ACCOUNT-FROM-DOMAIN@DOMAIN-NAME.DK>\r\n";
$headers .= "From: Message from Company name <UNUSED-EMAIL-ACCOUNT-FROM-DOMAIN@DOMAIN-NAME.DK>\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Sender: Message from Company name <UNUSED-EMAIL-ACCOUNT-FROM-DOMAIN@DOMAIN-NAME.DK>\r\n";
$headers .= "Content-type: text/plain; charset=\"utf-8\"; \r\n";
$headers .= "X-Mailer: PHP". phpversion() ."\r\n";
然后我像这样发送邮件:
mail($toName . '<'.$toEmail.'>', utf8_decode('Faktura på depositumet'), utf8_decode($someMessage), $headers);
...相同的结果(垃圾邮件)。
网络空间 One.com,所以我不能使用PHPmailer(因为必须安装,而这不能在一个.com的服务器上完成)。我无法用 One.com 来定义SPF。
我想要的只是能够发送不会成为垃圾邮件的电子邮件。
以下是我的问题:
是因为我的标题关闭了,还是“更深”的东西?
Gmail 垃圾邮件过滤器是禁止单个电子邮件帐户(如 )还是禁止整个域(如 )?
this@example.com
@example.com
- 可以以某种方式将列入黑名单的电子邮件列入白名单吗?
* 添加 1 *
还行。。。我现在已经尝试了很多事情:
- 我尝试添加LoneWolfPR的返回路径,就像推荐的那样,但它没有帮助。
- 我联系了 One.com(托管公司),并与他们确认,无法设置SPF记录或DKIM记录。事实并非如此。
- 我考虑过设置一个“取消订阅”链接,链接到一个带有表单的网站,但我不相信这种方法。我的意思是 - 发票一直通过电子邮件发送。为什么您应该能够取消订阅发票?!由于这在我的脑海中远远没有意义,所以我只尝试了大约20分钟(显然,没有结果)。
这是我当前的电子邮件标题(通过单击“查看原件”从Gmail获得):
Delivered-To: NEWLY-CREATED-GMAIL-ACCOUNT@gmail.com
Received: by 10.76.75.104 with SMTP id b8csp48728oaw;
Sat, 16 Mar 2013 17:32:56 -0700 (PDT)
X-Received: by 10.152.116.45 with SMTP id jt13mr7897860lab.0.1363480376067;
Sat, 16 Mar 2013 17:32:56 -0700 (PDT)
Return-Path: <XXX111@DOMAIN-NAME.dk>
Received: from mail-out2.b-one.net (mail-out2.one.com. [91.198.169.19])
by mx.google.com with ESMTP id p10si4637427lbb.120.2013.03.16.17.32.55;
Sat, 16 Mar 2013 17:32:55 -0700 (PDT)
Received-SPF: neutral (google.com: 91.198.169.19 is neither permitted nor denied by best guess record for domain of XXX111@DOMAIN-NAME.dk) client-ip=91.198.169.19;
Authentication-Results: mx.google.com;
spf=neutral (google.com: 91.198.169.19 is neither permitted nor denied by best guess record for domain of XXX111@DOMAIN-NAME.dk) smtp.mail=XXX111@DOMAIN-NAME.dk
Date: Sat, 16 Mar 2013 17:32:55 -0700 (PDT)
Message-Id: <51450f37.6a0b700a.6239.5dbcSMTPIN_ADDED_MISSING@mx.google.com>
Received: from localhost.localdomain (srv18.one.com [193.202.110.18])
by mail-out2.b-one.net (Postfix) with ESMTP id F3D0B10365
for <NEWLY-CREATED-GMAIL-ACCOUNT@gmail.com>; Sun, 17 Mar 2013 01:32:53 +0100 (CET)
Received: from 85.218.159.219 by www.DOMAIN-NAME.dk via URL_TO_THE_SCRIPT.php with HTTP; Sun, 17 Mar 2013 00:32:53 +0000
To: RECIEVERS_NAME <NEWLY-CREATED-GMAIL-ACCOUNT@gmail.com>
Subject: EMAIL-SUBJECT
X-PHP-Originating-Script: 87486:NAME-OF-THE-SCRIPT-THE-E-MAIL-WAS-SENT-FROM.php
Reply-To: COMPANY NAME <XXX111@DOMAIN-NAME.dk>
From: Besked fra COMPANY NAME <XXX111@DOMAIN-NAME.dk>
MIME-Version: 1.0
Sender: Besked fra COMPANY NAME <XXX111@DOMAIN-NAME.dk>
Content-type: text/plain; charset="utf-8";
X-Mailer: PHP5.3.21