im trying to send email from my VPS to a hotmail account using postfix and PEAR Mail, its sends perfectly to yahoo, gmail, but to hotmail goes straight to junk, i know whis question has been asked before, and i've tried everything,
my host name is libreriaplenitud.mx
here's my php script
include('Mail.php');
include('Mail/mime.php');
// Constructing the email
$sender = "Jorge <jorgegc21#libreriaplenitud.mx>"; // Your name and email address
$recipient = "El Yorch <jorgegc_21#hotmail.com>"; // The Recipients name and email address
$subject = "Test Email"; // Subject for the email
$text = 'This is a text message.'; // Text version of the email
$html = '<html><body><p>This is a html message</p></body></html>'; // HTML version of the email
$crlf = "\n";
$headers = array(
'From' => $sender,
'Return-Path' => $sender,
'Subject' => $subject
);
// Creating the Mime message
$mime = new Mail_mime($crlf);
// Setting the body of the email
$mime->setTXTBody($text);
$mime->setHTMLBody($html);
$body = $mime->get();
$headers = $mime->headers($headers);
// Sending the email
$mail =& Mail::factory('mail');
if($mail->send($recipient, $headers, $body)){
echo 'email sent succesfully';
}
and here are the headers that hotmail is receiving
Authentication-Results: hotmail.com; spf=none (sender IP is 192.34.60.167)
smtp.mailfrom=www-data#libreriaplenitud.mx; dkim=none header.d=libreriaplenitud.mx;
x-hmca=none
X-SID-PRA: jorgegc21#libreriaplenitud.mx
X-AUTH-Result: NONE
X-SID-Result: NONE
X-Message-Status: n:n
X-Message-Delivery: Vj0xLjE7dXM9MDtsPTA7YT0wO0Q9MjtHRD0yO1NDTD02
X-Message-Info:
11chDOWqoTkNi4xaXoUxBJHNxb4q3jMdTE9occzTaBqAAmPh8MI+3AvSCyxtKvnRXgUwZQ9hB9zRIQG0MbHnJc1TejqWYpS9Vk7aOR7/8zlZcfOTkN+DLYQYashlrK5kkvMohRBt73VDj9hh9fgOPZb7AfegtTPz
Received: from libreriaplenitud.mx ([192.34.60.167]) by COL0-MC1-F2.Col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4900);
Sun, 14 Apr 2013 14:51:31 -0700
Received: by libreriaplenitud.mx (Postfix, from userid 33)
id 2498040A95; Sun, 14 Apr 2013 21:51:31 +0000 (UTC)
To: El Yorch <jorgegc_21#hotmail.com>
Subject: Test Email
X-PHP-Originating-Script: 0:mail.php
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="=_4404fe2999b34dc58f10c890ae3d5e76"
From: Jorge <jorgegc21#libreriaplenitud.mx>
Message-Id: <20130414215131.2498040A95#libreriaplenitud.mx>
Date: Sun, 14 Apr 2013 21:51:31 +0000 (UTC)
Return-Path: www-data#libreriaplenitud.mx
X-OriginalArrivalTime: 14 Apr 2013 21:51:32.0085 (UTC) FILETIME=[39DB8250:01CE395A]
--=_4404fe2999b34dc58f10c890ae3d5e76
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=ISO-8859-1
This is a text message.
--=_4404fe2999b34dc58f10c890ae3d5e76
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=ISO-8859-1
<html><body><p>This is a html message</p></body></html>
--=_4404fe2999b34dc58f10c890ae3d5e76--
i think im not blacklisted, i've just set up this vps
any ideas what might be wrong?
thanks in advance
It's not the email library but your MX domain, mainly the fact you are missing some things.
You have to setup DomainKeys / DKIM and SPF in order for your emails to be legit.
And, even after you setup these, don't expect to go inbox, it will be 50/50 chances for this to happen. Email is a real nightmare nowadays.
The only reason why you go inbox right now is because your ip address is clean and did no spam, but don't expect this to last, you'll get blacklisted sooner or later.
Just a hint, you can use smth like http://mandrill.com/ (they have a nice api) for sending emails, it is free for small amount of emails and can get you going pretty fast, mostly the important thing is that you will reach the inbox everytime and you don't have to go through the nightmare called email setup.
Related
We are using SwiftMailer in one of our functions who sends emails out.
At the end, there is a general report sent to the department manager in order to keep trace and be informed about the function usage.
The manager is now willing to also receive a copy of the email sent out, we could do this by adding one email copy as attachment to the email report.
Any idea on how can we create a swiftmailer message and not sending it, only using it as attachment for a new swiftmailer email.
You could add your Swift_Message as an attachment like this:
$attachment = new \Swift_Attachment($messageAttachment, 'some-email.txt', 'text/plain');
However, your email would be now attached as an .txt file which contains all mail details. I'm not sure if this is the expected behaviour!?
Full example:
$messageAttachment = (new \Swift_Message('Attached Email'))
->setFrom('yourmail#gmail.com')->setTo('yourmail#gmail.com')
->setBody("Attached Email Body", 'text/plain');
$attachment = new \Swift_Attachment($messageAttachment, 'some-email.txt', 'text/plain');
$message = (new \Swift_Message('Real Email'))
->setFrom('yourmail#gmail.com')->setTo('yourmail#gmail.com')
->setBody("Real Email Body", 'text/plain')
->attach($attachment);
$mailer->send($message);
The content of the attached some-email.txt will look like this:
Message-ID: <568d128d97e530d1389cb83b154d64eb#swift.generated>
Date: Tue, 05 Dec 2017 17:00:05 +0100
Subject: Attached Email
From: yourmail#gmail.com
To: yourmail#gmail.com
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Attached Email Body
I have a need for everyone in my organization to send emails to everyone else in the group.
As there are hundreds of members, and the membership changes often, it is not practical to use the traditional CPanel email forwarding method. So I thought I would pipe the email to a php script, get all the members’ email addresses from the database (checking to make sure the original sender was also in the database) and send on the email to all members using PHPMailer.
I parsed the header in the PHP script to get the From, Subject (adding these of course to PHPMailer), Content-Type, and boundary. Then I collected the actual email message in a variable $message including the lines that say (in this case)
“This is a multi-part message in MIME format.
--------------3D4FAACFC2C069EFCDAE6DC6, etc. (This is of course in text format.)
Just before the PHPMailer Send command, I included:
$mail -> IsHTML(false);
// (I also tried not including this command at all – no change)
$mail->Body =$message;
$mail->addCustomHeader("Content-Type", $content_type . " boundary=" . $boundary);
$content_type and $boundary are the variables I parsed from the original header
As this is still in development, I sent the email to my address only. It was received and displayed properly (both the plain and html as usual), but was marked as Spam – the received Header had the Subject already marked as Spam so I assume PHPMailer did it.
I noticed on the received Header that my custom header appeared correctly:
Content-Type: multipart/alternative; boundary="------------3D4FAACFC2C069EFCDAE6DC6"
The received header also had another Content-Type: text/plain; charset=iso-8859-1 after the above which I assume PHPMailer added. Maybe the two Content-Types is what triggered the Spam tag. I then tried adding $mail->header_remove ('Content-Type'); after the Body call and before addCustomHeader, but the additional Content-Type: text/plain; charset=iso-8859-1 was still in the received header and it was still marked as Spam.
I am using PHPMailer version 5.2.22, and using
$mail->IsSMTP();
, $mail->SMTPAuth = true;
$mail->SMTPSecure = 'ssl';
I can’t continue to unsuccessfully experiment forever as I am afraid sending lots of Spam emails will get me in trouble, so I am hoping someone can tell what I am doing wrong, or even if my overall strategy is flawed. I wish also there was a way to get the header that PHPMailer is going to use before it actually sends out the mail.
Note: my organization is a charitable group with little money, so we can't afford paid SMTP's. I've tried using the free versions of some on the market (not for the above project) but given you are using a shared IP with many others using the free service you often get emails kicked back because others sharing your IP have been Spam tagged
Thanks
This is the entire header (I deleted some of the content just to keep this note a bit brief) that I received to my personal email (b...#....com) from my "forward email" script which uses everybody#....org as the originating address. You can see the Content_Type I added to PHPMailer via $mail->addCustomHeader("Content-Type", $content_type . " boundary=" . $boundary);(which is the multipart.. line) and the one PHPMailer itself added (text/plain...). The email was received fine and displayed properly except for the Spam added to the Subject line:
From - Sat Mar 25 12:51:13 2017
STUFF
Return-Path: <everybody#....org>
Received: from dnvrco-pub-iedge-vip.email.rr.com ([107.14.70.244])
by dnvrco-fep06.email.rr.com
(InterMail vM.8.04.03.24 201-2389-100-172-20151028) with ESMTP
id <20170325165112.EUNA23395.dnvrco-fep06.email.rr.com#dnvrco-pub-iedge-vip.email.rr.com>
for <bmadder#...>; Sat, 25 Mar 2017 16:51:12 +0000
Return-Path: <everybody#....org>
Received: from [173.205.126.142] ...
Received: from ecbiz194.inmotionhosting.com .....
Date: Sat, 25 Mar 2017 12:51:01 -0400
To: b...#....com
From: everybody#....org
Message-ID: ...
Content-Type: multipart/alternative; boundary="------------3D4FAACFC2C069EFCDAE6DC6"
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-OutGoing-Spam-Status: No, score=-1.0
X-AntiAbuse:...
X-Get-Message-Sender-Via: ecbiz194.inmotionhosting.com: authenticated_id: everybody#....org
X-Authenticated-Sender: ecbiz194.inmotionhosting.com: everybody#....org
X-Source:
X-Source-Args:
X-Source-Dir:
X-Authority-Analysis: v=2.1 cv=Od5ldUnY c=1 sm=1 tr=0 p=tHMjoff1TzQA:10 a=BPsZ5WN3F+ptBTNoNLYonA==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=9+rZDBEiDlHhcck0kWbJtElFXBc=:19 a=6Iz7jQTuP9IA:10 a=FqPqrT7mAAAA:8 a=wuaQj91YKeLcW_I7NZUA:9 a=FtJ_xtNkBE-qfxEx:21 a=wPNLvfGTeEIA:10 a=yozH4VhRfl4A:10 a=M3AHoUkWFckA:10 a=fZGknuNN1LOydenUCIb6:22
X-Cloudmark-Score: 100
X-RR-Connecting-IP: 107.14.64.106:25
Subject: SPAM: Lots of work today
X-Brightmail-Tracker: AAAAARZYL6Q=
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrDqMTGxcIABLocC65FGFx/aGGx78B3FgdGj+Mv3jMFMEZx+OWXKAQXJOYmcGT07L7AVsBQAaIaGBlWMSqUlBYbF2cUJxYVF6RWGJjrpacW6xVX5ibmlaQm6yXn525ihJq+g3H7RZlTjJJS4ry3512LEBIoBpqYUQpUVxRfVJqTWvyKUZyDUUmYNxcky5OZV1KcmQ6TkeBgUhLhNdl4JUKIt7gkESEl1cDY81CZ25t3k/zUd21bd90/typmy6NtErw+Xs/YlXtk7atb4j4+/t6yoHDeJ3uN/kP1P7LrIiY5fFipZfynvvPJzbNfz943kPtyweqk3Tn/vpOfGIosVIpPxHht7j+Rl24XEH2vJa1o/q3fJRonvyxi6D4x60xlW8M/o0oLBlvjw4672ZjKQg2UWIozEg21mIuKEwGcu2V6TwEAAA==
This is a multi-part message in MIME format.
--------------3D4FAACFC2C069EFCDAE6DC6
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
This is the text message
--------------3D4FAACFC2C069EFCDAE6DC6
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>This is the text message <br>
</p>
</body>
</html>
--------------3D4FAACFC2C069EFCDAE6DC6--
I now have the solution. Rather than using the line of $mail->addCustomHeader("Content-Type", $content_type . " boundary=" . $boundary);, I appended the variable $boundary to the variable $content_type and used $mail->ContentType = $content_type; My mail forward script now works perfectly with the Spam label no longer an issue. The header that is sent to the final recipients no longer has duplicate Content-Types listed in the MIME part
I cant get the server to accept my email sent from my end basically i realise it's sending two super different stuff from laravel's mail comparing to hotmail & thunderbird
Basically ,What i normally do is to use hotmail to reply but now i have multiple hotmail i have to manage therefore i was trying to send the email from my web application (laravel) for easier management but the "server" i'm sending to doesnt accept my normal php mail format. I'm definately missing something. Any email experts can advice on this?
Suspect
My content is not BASE64
In-Reply-To < Not sure about this
I'm using Hotmail's SMTP
Normal PHP
X-TMN: [Rmqa/GDhCTtKz/QHzf3PJ3OwikNcUBK3]
X-Originating-Email: [My Email]
Message-ID: <BLU436-SMTP1442C473F3D4FDD87CB62F29A410#phx.gbl>
Return-Path: Email.com
Date: Wed, 14 Jan 2015 17:06:08 +0800
Subject: RE: Subject
From: My Email
To: "Email.com"
<Email.com>
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-OriginalArrivalTime: 14 Jan 2015 09:06:40.0049 (UTC) FILETIME=[68728A10:01D02FD9]
Email Content in pure Text here
Hotmail(Web based)/thunbird style
X-TMN: [vnGLLjV7gUOyWwB/t0Ipyc0a9UiAeX10]
X-Originating-Email: [My Email]
Message-ID: <BAY180-W3892FACB7ED35FBDFF773B9A410#phx.gbl>
Return-Path: My Email
Content-Type: multipart/alternative;
boundary="_4c14973f-4b86-4f73-b78c-eac0375a1262_"
From: My Email
To: "Email.com"
<Email.com>
Subject: RE: Subject
Date: Wed, 14 Jan 2015 17:03:32 +0800
Importance: Normal
In-Reply-To: <14ae7acae73.1948.26c1bd#ismtpd-063>
References: <14ae7acae73.1948.26c1bd#ismtpd-063>
MIME-Version: 1.0
--_4c14973f-4b86-4f73-b78c-eac0375a1262_
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: base64
<base64 here>
--_4c14973f-4b86-4f73-b78c-eac0375a1262_--
Manage to solve it, as suspected, it's Base64. Basically , I had to customize the content Type on my laravel.
$message->getHeaders()->addTextHeader('Content-Type', 'text/plain; charset="gb2312"');
$message->getHeaders()->addTextHeader('Content-Transfer-Encoding', 'base64');
I am using following code to send email whosoever registers.
$recmail = 'saket.mishra#atlascorps.org'; // address you want the form mailed to
$sub = "Atlas Corps Questionnaire"; //subject of email that is sent
$mess = "Hello, Please fill a questionnaire at following link. ";
$headers = "From: Atlas Corps Family Tree < info#atlascorps.org > \n" .
"MIME-Version: 1.0\n" .
"Content-type: text/html; charset=iso-8859-1";
mail($recmail,$sub,$mess,$headers);
My saket.mishra#atlascorps.org is a valid Gmail Account.
But i am not receiving any emails here.
I have checked all my setting of gmail properly.
No forwarding and filtering is applied.
where as my other Gmail Account: saket.me#gmail.com
Is receiving all the emails through this website.
Please help, as all my customers will have the #atlascorps.org email account on Gmail.
On Email Logs of the server, following message is there
Return-path: <>
Envelope-to: atlascorpsadmin#p3plcpnl0096.prod.phx3.secureserver.net
Delivery-date: Tue, 23 Sep 2014 08:56:11 -0700
Received: from mailnull by p3plcpnl0096.prod.phx3.secureserver.net with local (Exim 4.82)
id 1XWSRn-0003Fc-2A
for atlascorpsadmin#p3plcpnl0096.prod.phx3.secureserver.net; Tue, 23 Sep 2014 08:56:11 -0700
X-Failed-Recipients: saket.mishra#atlascorps.org
Auto-Submitted: auto-replied
From: Mail Delivery System <Mailer-Daemon#p3plcpnl0096.prod.phx3.secureserver.net>
To: atlascorpsadmin#p3plcpnl0096.prod.phx3.secureserver.net
Subject: Mail delivery failed: returning message to sender
Message-Id: <E1XWSRn-0003Fc-2A#p3plcpnl0096.prod.phx3.secureserver.net>
Date: Tue, 23 Sep 2014 08:56:11 -0700
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
saket.mishra#atlascorps.org
------ This is a copy of the message, including all the headers. ------
Return-path: <atlascorpsadmin#p3plcpnl0096.prod.phx3.secureserver.net>
Received: from atlascorpsadmin by p3plcpnl0096.prod.phx3.secureserver.net with local (Exim 4.82)
(envelope-from <atlascorpsadmin#p3plcpnl0096.prod.phx3.secureserver.net>)
id 1XWSRm-0003FX-Vo
for saket.mishra#atlascorps.org; Tue, 23 Sep 2014 08:56:11 -0700
To: saket.mishra#atlascorps.org
Subject: Atlas Corps Questionnaire
X-PHP-Script: atlascorps.org/globe/send_link.php for 122.176.7.34
X-PHP-Originating-Script: 209330:send_link.php
From: Atlas Corps Family Tree < info#atlascorps.org >
MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1
Message-Id: <E1XWSRm-0003FX-Vo#p3plcpnl0096.prod.phx3.secureserver.net>
Hello
I would suggest you check your DNS settings and mainly the SPF record you have. If you go to the kitterman tool for SPF checks, you'll see that your SPF record appears to be invalid:
Input accepted, querying now...
evaluating v=spf1 a mx ptr include:secureserver.net ~all ...
Results - PermError SPF Permanent Error: Too many DNS lookups
My guess is that google is sometimes failing to resolve all secureserver.net records, therefore it's bouncing back some messages. Instead of having include:secureserver.net try removing it and setting an MX record that points to your server. The SPF record is set to allow all MX records to send emails, so that should work fine.
Also, I would suggest using a mailer library such as SwiftMailer, which is quite easier to maintain and debug than the default php mailer function. Here is a snippet code, which can give you a head start:
require_once '/path/to/swift-mailer/lib/swift_init.php';
// Create the message
// http://swiftmailer.org/docs/messages.html
$message = Swift_Message::newInstance();
$message->setFrom('info#atlascorps.org', 'Atlas Corps Family Tree');
$message->setTo('saket.mishra#atlascorps.org');
$message->setContentType('text/html');
$message->setCharset('iso-8850-1');
$message->setSubject('Atlas Corps Questionnaire');
$message->setBody('<html><head></head><body>Hello, Please fill a questionnaire at following link.</body></html>');
// Create the Transport
// http://swiftmailer.org/docs/sending.html#the-smtp-transport
$transport = Swift_SmtpTransport::newInstance('localhost', 25);
// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
$mailer->send($message);
Hope this helps.
Your mail server (exim) will have log files, probably in /var/log/mail/log or nearby, and this will have more detail about why your deliveries are failing. Unfortunately the bounce you posted doesn't contain any useful information.
Expanding on tftd's answer:
RFC4408 imposes a limit of 10 lookups. There's a good analysis of SPF lookup counting here. The killer clause in your SPF is mx because it lists 5 mail servers. secureserver.net's SPF record only contains ip4 clauses, so will not incur any additional lookups. In the SPF you really don't need ptr (and you don't have a DNS entry for that anyway), so that will save a lookup, and since your a record is only a single IP, it would be a good idea to list that explicitly first. I'd suggest you alter your SPF to this to minimise lookup count:
v=spf1 ip4:192.186.207.194 include:secureserver.net mx a ~all
I've left the a in there in case you change your IP and forget to update this record...
All that said, this won't necessarily mean that your SPF is preventing deliveries, since a mail server will stop checking check SPF entries when it finds a match, and if it matches one of your MXs that will be well before the lookup limit.
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: +44(0)1202 763339<u></u><u></u></p>
<p>e: info#cash-access.com<u></u><u></u></p>
<p>w: www.cash-access.com<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);
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).
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";
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";
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.
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.
Words like cash and virus in your content are likely to flag this as spam in outlook.
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