I want to send HTML emails from my site, but Outlook is flagging them as spam

放肆的年华 提交于 2021-01-07 07:46:33

问题


How to get Outlook to approve my email and not treat it as spam?

I read it's something to do with the headers; here is my email headers.

Received: from smtp-in-75.livemail.co.uk (213.171.216.76) by
 exch-ht02.email.local (10.44.216.65) with Microsoft SMTP Server id
 14.1.355.2; Fri, 25 Nov 2011 12:16:47 +0000
Received: from virus_14.livemail.co.uk (virus-cluster.livemail.co.uk
 [213.171.216.10])  by smtp-in-75.livemail.co.uk (Postfix) with SMTP id
 22A126540B7    for <info@cash-access.com>; Fri, 25 Nov 2011 12:16:45 +0000 (GMT)
X-Spam-Flag: YES
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
    spam_208.livemail.co.uk
X-Spam-Level: **********
X-Spam-Status: Yes, score=10.6 required=5.0 tests=FH_FROM_CASH,
    HTML_IMAGE_ONLY_12,HTML_MESSAGE,HTML_MIME_NO_HTML_TAG,MIME_HEADER_CTYPE_ONLY,
    MIME_HTML_ONLY shortcircuit=no autolearn=disabled version=3.2.5
X-Spam-Report: *  3.0 FH_FROM_CASH From name has "cash"
    *  2.6 HTML_IMAGE_ONLY_12 BODY: HTML: images with 800-1200 bytes of words
    *  0.0 HTML_MESSAGE BODY: HTML included in message
    *  2.3 MIME_HTML_ONLY BODY: Message only has text/html MIME parts
    *  1.0 MIME_HEADER_CTYPE_ONLY 'Content-Type' found without required MIME
    *      headers
    *  1.7 HTML_MIME_NO_HTML_TAG HTML-only message, but there is no HTML tag
Received: from cust-smtp-193.fasthosts.net.uk (smtp-out-60.livemail.co.uk
 [213.171.216.60])  by smtp-in-165.livemail.co.uk (Postfix) with ESMTP id
 710E5EB00B9    for <info@cash-access.com>; Fri, 25 Nov 2011 12:16:40 +0000 (GMT)
Received: from linweb04.linvh1.fasthosts.co.uk (unknown [88.208.252.195])   by
 cust-smtp-193.fasthosts.net.uk (Postfix) with ESMTP id 27B5F14100A9;   Fri, 25
 Nov 2011 12:16:40 +0000 (GMT)
Received: by linweb04.linvh1.fasthosts.co.uk (Postfix, from userid 1040243723)
    id 21D2A1F609; Fri, 25 Nov 2011 12:16:40 +0000 (GMT)
To: <info@cash-access.com>
Subject: -----SPAM----- Your Pension Backed Loan Enquiry
From: <info@cash-access.com>
Content-Type: text/html
CC: <stevewolfe71@gmail.com>
Message-ID: <20111125121640.21D2A1F609@linweb04.linvh1.fasthosts.co.uk>
Date: Fri, 25 Nov 2011 12:16:40 +0000
X-Spam-Prev-Subject: Your Pension Backed Loan Enquiry
X-Original-To: info@cash-access.com
X-AntiVirus: checked by Vexira MailArmor
Return-Path: user_1040238723@linweb04.linvh1.fasthosts.co.uk
X-MS-Exchange-Organization-AuthSource: exch-ht02.email.local
X-MS-Exchange-Organization-AuthAs: Anonymous
MIME-Version: 1.0

And here is my php code.

$id = $_GET['id'];
$date = date('y-m-d h:i:s');


$recipient = $_GET['email'];
$lname = $_GET['lname'];
$fname = $_GET['fname'];
$title = $_GET['title'];

    $to = $recipient; 
    $from = "info@cash-access.com"; 
    $subject = "Your Pension Backed Loan Enquiry"; 

    $message = '
<p>Dear '.$title.' '.$fname.' '.$lname.'<u></u><u></u></p>
<p><u></u></p>
<p>We have received your enquiry from Pension Backed Loans and we will be in contact with you to discuss your requirements alternatively you can call us on 01202 763339.<u></u><u></u></p>
<p><u></u> <u></u></p>
<p>Yours sincerely<u></u><u></u></p>
<p><strong>Joanne Hearn<u></u><u></u></strong></p>
<p>Cash Access<u></u><u></u></p>
<p>7a Milburn Road<u></u><u></u></p>
<p>Westbourne<u></u><u></u></p>
<p>Bournemouth<u></u><u></u></p>
<p>Dorset BH4 9HJ<u></u><u></u></p>
<p><u></u> <u></u></p>
<p>t: <a href="tel:%2B44%280%291202%20763339" value="+441202763339" target="_blank">+44(0)1202 763339</a><u></u><u></u></p>
<p>e: <a href="mailto:info@cash-access.com" target="_blank">info@cash-access.com</a><u></u><u></u></p>
<p>w: <a href="http://www.cash-access.com/" target="_blank">www.cash-access.com</a><u></u><u></u></p>
<p><u></u> <img src="http://cash-access.com/crm/logo.png" width="288" height="72" /></p>
'; 
    $headers  = "From: $from\r\n"; 
    $headers .= "Content-type: text/html\r\n"; 

    $headers .= "Cc: stevewolfe71@gmail.com"; 

    mail($to, $subject, $message, $headers); 

回答1:


It is not Outlook but the spam filter of livemail.co.uk that flags your message as spam.

And it tells you why:

3.0 FH_FROM_CASH From name has "cash"

Obviously cannot be fixed.

2.6 HTML_IMAGE_ONLY_12 BODY: HTML: images with 800-1200 bytes of words

Either remove the image or increase the word count.

0.0 HTML_MESSAGE BODY: HTML included in message

No impact. No need to get fixed.

2.3 MIME_HTML_ONLY BODY: Message only has text/html MIME parts

You should always send multipart messages (containg a non-HTML version). Here is a tutorial.

1.0 MIME_HEADER_CTYPE_ONLY 'Content-Type' found without required MIME headers

Should get fixed by sending a proper multipart message.

1.7 HTML_MIME_NO_HTML_TAG HTML-only message, but there is no HTML tag

Add an <html> tag.

The larger the leading number (weight), the bigger the impact.

Depending on the spam filter's configuration, the following may decrease the weight:

  • Apply for an entry in a whitelist (e.g., dnswl.org).

  • Add Sender Policy Framework (SPF) records.

  • Use DomainKey Identified Mail (DKIM).




回答2:


You didn't set MIME type in your header - when sending html emails you must set it like this:

$headers  .= 'MIME-Version: 1.0' . "\r\n";

Also make sure you set reply-to header the same as from header:

$headers  .= 'Reply-To: info@cash-access.com' . "\r\n";



回答3:


Try this:

$headers = "From:".$from . "\r\n";
    $headers .= "Reply-To: some@example.com" . "\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";



回答4:


Take a look at using SPF records in your DNS to verify your email server, this will make the email much more trusted than just looking at it's contents. Some servers (e.g. hotmail) will reject your email straight-up without it.




回答5:


If you're hosting your site on a shared server, then your email won't actually be coming from cash-access.com, but instead from your host's email server, and will be signed as such. Outlook (and email providers, such as Gmail) see that the actual sender doesn't match the from address. You need to update SPF records (you can do this via cPanel, if your host has it installed) to rectify the issue.




回答6:


Words like cash and virus in your content are likely to flag this as spam in outlook.




回答7:


Generally with sending messages you need to send from the same server as the email domain or use an send command that send via the email domains smtp server which is most often the case when using web hotels or if you don't have the email server on the same virtual/physical server. If you don't have a smtp server to send from a free solution is to make a gmail: http://lifehacker.com/111166/how-to-use-gmail-as-your-smtp-server



来源:https://stackoverflow.com/questions/8269067/i-want-to-send-html-emails-from-my-site-but-outlook-is-flagging-them-as-spam

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!