Jump to content

Hotmail detecting as spam mail() function


ibnclaudius

Recommended Posts

The emails sent with mail() to Hotmail is ending in the Junk Mail,  but with Gmail, Yahoo etc. is everything ok. I'm have problem only with hotmail. Why?

 

Here is the code:

 

<?php

include('config.php');

$getUser_sql_not_sent = "SELECT * FROM emails WHERE sent = '0' LIMIT 10";
$getUser_not_sent = mysql_query($getUser_sql_not_sent);
$getUser_num_not_sent = mysql_num_rows($getUser_not_sent);

while ($row = mysql_fetch_array($getUser_not_sent)) {
$boundary = uniqid('np');
$emailUser = $row['email'];
$emailFrom = "faleconosco@campainha.com";
$emailSubject = 'A vida do profissional imobiliário ficou mais fácil';
$emailVerify = "http://www.campainha.com/verify.php?email=" . $emailUser;
$boundary = uniqid('np');
$emailHeaders = "From: Campainha <" . $emailFrom . ">\r\n";
$emailHeaders .= "X-Mailer: PHP/" . phpversion() . "\r\n";
$emailHeaders .= "MIME-Version: 1.0\r\n";
$emailHeaders .= "Content-Type: multipart/alternative;boundary=" . $boundary . "\r\n";
$emailHeaders .= "Content-Transfer-Encoding: ­ 8bit\r\n\r\n";
$emailBody = "\r\n\r\n--" . $boundary . "\r\n";
$emailBody .= "Content-type: text/html;charset=utf-8\r\n\r\n";
$emailBody .= "<a href = \"$emailVerify\"><img src = \"http://www.campainha.com/campainha.jpg\" alt = \"Campainha\" /></a>";
$emailBody .= "\r\n\r\n--" . $boundary . "--";
if (mail($emailUser, '=?UTF-8?B?'.base64_encode($emailSubject).'?=', $emailBody, $emailHeaders)) {
	mysql_query("UPDATE emails SET sent = '1' WHERE email = '$emailUser'") or die (mysql_error());
}

}
exit;

?>

Link to comment
Share on other sites

Different email servers use different criteria for detecting spam. It has nothing to do with using the mail() function. The spam filters look at things such as the headers of the email, the subject, and the message itself which includes the structure of the message. Does the message contain links and are they properly formatted, are there links to executables. Are there any "red flag" words in the subject or message. Words related to loans, penis/breast enlargement, Nigerian bankers, etc. etc. could be triggering the spam program. Also, the receiving email server may be doing a reverse lookup based on the "from" address. If you are sending an email as from "me@mydomain.com" but it is actually being sent from the email server myhostdomain.com that could be causing it.

 

There are many things you can do to try and prevent your email from being flagged as spam. But, there are no guarantees. If the methods to circumvent spam filters was public knowledge those filters would become useless since every spammer would employ those methods

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.