Currently I dev a html email template but I have a problem. My mail is always drop in spam because of it seems dangerous for google gmail. My template contains only text and pictures.
I try to fixe it :
td
tag, img
tag with src)All my pictures are stored on web server with SSL certificate The mail is droped in spam onky when I add pictures
Somebody can help me ?
1. Use Headers consider using headers to set your From and Reply-To email addresses.
<?php
$headers .= "Reply-To: The Sender <[email protected]>\r\n";
$headers .= "Return-Path: The Sender <[email protected]>\r\n";
$headers .= "From: The Sender <[email protected]>\r\n";
?>
But headers are good for more than just setting details about the sender. They are also important for setting the content type, the email priority, and more. Here are how some additional headers look.
<?php
$headers .= "Organization: Sender Organization\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-Mailer: PHP". phpversion() ."\r\n"
?>
Be sure to replace the fourth parameter with the $headers variable as shown below.
<?php
mail("[email protected]", "Message", "A simple message.", $headers);
?>
2. The Message Sender Domain and Server Domain Should Match Spammers are notorious for sending emails from one server and trying to make the recipient believe that it came from somewhere else. So if you are sending an email from [email protected], it is a good idea the the script reside on example.com.
3. Be Sure to Properly Use the Content-type Attribute The Content-type attribute enables a message sender to say whether or not an email is plain text or html, or whether it has attachments. Obviously, the easiest to use content type is text/plain. You just add your text as shown in the simple example, and you are done. But when you use the other content types, additional pieces might be expected. For example, with the text/html content type, an html body tag is expected. Not having this tag could result in your email being marked as spam.
4. Verify That Your Server Is Not Blacklisted When a server is blacklisted, it means that that server has identified as one that has been sending a lot of spam. This results in recipient mail servers rejecting or filtering any mail that is received from that server.
So if your mail is not being received it is a good idea to verify that your server has not been blacklisted. This goes for both shared and dedicated servers. In a shared environment, it is common for other users on the server to be sending out spam. And in a dedicated environment, spammers may have found a way to exploit a vulnerability in a server or contact form to send out spam. So it is easy for either type of server to be blacklisted.