Why can not I send an email to Hotmail?
Here is my code:
$boundary = sha1('whatever'); $headers = 'MIME-Version: 1.0'."\r\n"; $headers .= 'From: "Domainname" emailname@domain.com '."\r\n"; $headers .= 'Reply-to: Domainname < emailname@domain.com >'."\r\n"; $headers .= 'X-Priority: 3'."\r\n"; $headers .= 'X-Mailer: Mail 1.0'."\r\n"; $headers .= 'Subject: '.$subject."\r\n"; $headers .= 'Content-Type: multipart/alternative; boundary="'.$boundary.'"'."\r\n\r\n"; $message = '--'.$boundary."\r\n"; $message .= 'Content-Type: text/plain; charset="utf-8"'."\r\n\r\n"; $message .= $text."\r\n"; $message .= '--'.$boundary."\r\n"; $message .= 'Content-Type: text/html; charset="utf-8"'."\r\n\r\n"; $message .= $html."\r\n"; $message .= '--'.$boundary.'--'; mail($email, $subject, $message, $headers); He worked in Gmail, Yahoo, GMX ... but it did not work for Hotmail / Live / MSN.
Since it worked in Gmail, I can assume that it has nothing to do with my server, right?
I also tried it with:
mail(' username@hotmail.com ', 'This is a subject', 'This is the body'); Same problem. It doesn't even send my junk mail folder.
Old answer:
Hotmail is blocking domains without recording SPF. you can do here
change
As of June 2015 the general requirements:
1) Enabling DKIM DKIM in Exim is now a very important tool to reduce the likelihood that your messages will be marked as spam. It is strongly recommended that you enable DKIM for your domains.
2) An SPF record with -all instead of ~ all
3) DMARC entries to help remote servers decide what to do with failed DKIM / SPF messages.
4) Conventional things: a) as a reverse IP search when sending IP, b) direct search for this value rDNS, preferably indicating the same IP, c) MX record for the host name.
Example:
"v=spf1 a mx ip4:1.2.3.4 -all" Where 1.2.3.4 is the ip of your server.
All Internet service providers and e-mail servers have different methods of spam detection and blacklists. You must use a third-party entity that deals with the possibilities of delivery, on your behalf, such as SendGrid . Sending email using SendGrid is about as easy as you are in this matter. Look at this example . In addition, they have a pretty fair price and free level.
If you are using ec2, you should check out Amazon SES (Simple Email Service). Here FAQ
Microsoft uses various authentication filters to determine if the message is spam or not.
Common industry practices include checking e-mail for the authentication ID SPF, Sender ID and DKIM in the received message.
Sender ID Framework - is a protocol e-mail authentication technology that helps solve the problem of spoofing and phishing by verifying the domain name from which e-mail messages are sent.
SPF (Sender Policy Infrastructure) - is, in fact, DNS additional entry that points directly from any mail servers should expect to receive mail.
DKIM (DomainKey Identified Mail) - this is a new implementation of DomainKeys old system, which is essentially a more sophisticated approach to the verification / checking mail, which requires that the mail has been signed with the private key and checked for the public key found in the DNS record. This, in effect, acts as a safer version of the SPF.
You can send an email to the site test@domain.com to address check-auth@verifier.port25.com , and then will be sent an email indicating the testing DKIM, DomainKeys, SPF, SpamAssassin and Sender-ID.
However, in recent months, I have found that, despite including these elements in sent emails, Microsoft still refused legitimate emails. Microsoft has recommended to use the service "sender Way" , which is a service of the certification of paid services.
However, I found that after the recipient of our e-mail address is listed as a saved contact, they received our letters in order. Therefore, Ive created a business card for our company and encourage our customers to use e-mail service Hotmail or Windows Live, to save the business card as a contact to ensure correct delivery of our emails.