I'm using PHPMailer to send my emails via SMTP. I have a class where once initialized it automatically connects to my server through it's I.P address and logs into my email account.
Snippet from class,
function __construct()
{
global $PHPMailer;
$PHPMailer->IsSMTP();
$PHPMailer->Host = '67.222.10.87';
$PHPMailer->SMTPAuth = true;
$PHPMailer->Username = 'support@networkyourfortune.co.uk';
$PHPMailer->Password = "MYPASSWORD";
$PHPMailer->SMTPSecure = '';
}
public function sendEmail($email, $subject, $message, $altMessage) {
global $PHPMailer;
$PHPMailer->From = 'support@networkyourfortune.co.uk';
$PHPMailer->FromName = 'Network Your Fortune';
$PHPMailer->AddAddress($email);
$PHPMailer->AddReplyTo('support@networkyourfortune.co.uk', 'Support');
$PHPMailer->WordWrap = 50;
$PHPMailer->IsHTML(true);
$PHPMailer->CharSet = "text/html; charset=UTF-8;";
$PHPMailer->Subject = $subject;
$PHPMailer->Body = $message;
$PHPMailer->AltBody = $altMessage;
if($PHPMailer->Send())
return true;
else
return false;
}
Snippet from php file that sends the email,
$mailHandler = MailHandler::getInstance();
$HTMLMessage = "
<html>
<body>
<p>
Hello Jack,
We are so happy you have took your first step with us and welcome you to Network Your Fortune. We hope you are excited at our systems potential for all
our memebers.
Click the link below to get direct access to our website where you will find how you can join our free rota today!
<a href='http://networkyourfortune.co.uk/rotainfo/'>Click Here To See And Join Our Rota!</a>
</p>
</body>
</html>
";
$altMessage = "
<html>
<body>
<p>
Hello Jack,
We are so happy you have took your first step with us and welcome you to Network Your Fortune. We hope you are excited at our systems potential for all
our memebers.
Click the link below to get direct access to our website where you will find how you can join our free rota today!
Click Here To See And Join Our Rota!: http://networkyourfortune.co.uk/rotainfo/
</p>
</body>
</html>
";
if($mailHandler->sendEmail("web-drq5bn@mail-tester.com", "JACK RESPONSE REQUIRED: Add Yourself To Our Rota", $HTMLMessage, $altMessage))
echo "Sent";
else
echo "Error while sending";
The section of code above generates a message and sends it. The problem is that it just goes right into my spam folder on two different email accounts.
I did a test on my message via mail-tester.com, see results here.
It uses SpamAssassin which is an "Open Source anti-spam platform" and used across a HUGE number of email servers being a standard for spam filtering. The key results were as shown,
It says, "HTML: images with 800-1200 bytes of words You should write more text in your email". Doing a little research this error seems to be flagged if you have no text at all and only an image. I have text and no images!
It says, "HTML and text parts are different". If you have HTML links and you have to remove them for alt version then of course it's going to be a little different, that's 0.724 points lost because of that!
It also says, "Delivered to internal network by a host with no rDNS", where I have contacted my hosting provider for my virtual private server and they have verified that reverse DNS is working perfectly..
It's the worst feeling when not a single one of your messages deliver without going into spam. Could someone please enlighten on where or who is going wrong here. I really appreciate any help towards my problem.