TL; DR:從共享主機(例如來自Unoeuro或One.com的廉價域)發送的郵件以垃圾郵件結尾。怎麼修?繞過Gmail的垃圾郵件過濾器(使用PHP從共享主機發送的郵件)
我發了郵件系統,首先生成一個PDF文件(使用FPDF),隨後其發出的PDF文件與PHP的Swiftmailer的附件。這封電子郵件已發送給130人(作爲「一張」發票)。但它幾乎每個人都登陸垃圾郵件過濾器。我嘗試調整SwiftMailer標題設置,但沒有任何運氣。即使是我以前沒有寄過的郵件(經過全面測試)。這是我的初始設置:
function sendMailEt($toEmail, $toName, $invoiceNumber){
require_once('includes/lib/swift_required.php');
$transport = Swift_SmtpTransport::newInstance('mailout.one.com', 25)
->setUsername('[email protected]')
->setPassword('THE-PASSWORD')
;
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance('FROM COMPANY')
->setSubject('Thanks for signing up - COMPANY')
->setFrom(array('[email protected]' => '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 <[email protected]>\r\n";
$headers .= "Return-Path: Company name <[email protected]>\r\n";
$headers .= "From: Message from Company name <[email protected]>\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Sender: Message from Company name <[email protected]>\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(因爲必須安裝它,而且這不能在one.com的服務器上完成)。我無法用One.com定義SPF。
我想要的就是能夠發送沒有發送垃圾郵件的電子郵件。
這裏是我的問題:
是不是因爲我的頭是關閉的,或者是它的東西「更深層次的下跌」?
請問Gmail的垃圾郵件過濾器的禁令單個電子郵件帳戶(如
[email protected]
)或它禁止整個域(如@example.com
)?- 是否可以將列入黑名單的電子郵件列入白名單 莫名其妙?
*加1 *
好吧......我現在已經嘗試了一些東西:
- 我嘗試添加LoneWolfPR的ReturnPath這樣,如建議,它沒沒有幫助。
- 我聯繫了One.com(託管公司),並與他們確認,無法設置SPF記錄或DKIM記錄。它仍然不是。
- 我考慮建立一個'取消訂閱'鏈接,並且鏈接到帶有表單的網站,但我不相信這種方法。我的意思是 - 通過電子郵件隨時發送發票。爲什麼你應該能夠取消訂閱發票?既然這讓我頭腦中的感覺遠遠不夠,那麼我只用了大約20分鐘(顯然,沒有結果)。
這是我目前的電子郵件標頭(從Gmail中得到,通過點擊「查看原圖」):
Delivered-To: [email protected]
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: <[email protected]>
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 [email protected]) 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 [email protected]) smt[email protected]
Date: Sat, 16 Mar 2013 17:32:55 -0700 (PDT)
Message-Id: <[email protected]>
Received: from localhost.localdomain (srv18.one.com [193.202.110.18])
by mail-out2.b-one.net (Postfix) with ESMTP id F3D0B10365
for <[email protected]>; 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 <[email protected]>
Subject: EMAIL-SUBJECT
X-PHP-Originating-Script: 87486:NAME-OF-THE-SCRIPT-THE-E-MAIL-WAS-SENT-FROM.php
Reply-To: COMPANY NAME <[email protected]>
From: Besked fra COMPANY NAME <[email protected]>
MIME-Version: 1.0
Sender: Besked fra COMPANY NAME <[email protected]>
Content-type: text/plain; charset="utf-8";
X-Mailer: PHP5.3.21
您是否爲您發送域名的PTR DNS記錄?使用http://emailtalk.org/MailServerConfig.aspx – DaveHogan 2013-03-07 14:48:29
等工具測試您的域名當我在鏈接到的頁面上輸入域名時,它會顯示'找不到記錄'。如果我在導航中(在同一網站上)選擇「PTR Check」並插入域名,那麼它會告訴我:193.202.110.18 PTR指向srv18.one.com。 - 是好還是壞?我該如何改變它? – Zeth 2013-03-07 21:21:02
您發送的域名(電子郵件的發件人)是否與one.com匹配?你沒有任何MX記錄? – DaveHogan 2013-03-08 13:25:09