nofel — 2011-09-28T11:27:57-04:00 — #1
Hi, i have tried everything i can find on net to make my script not getting into spam but its not working, i tried on google and hotmail too. what should i do, maybe i m missing something. here is my code
$to = "firstname.lastname@example.org";
$fromname = "";
$random_hash = md5(date('r', time()));
//define the headers we want passed. Note that they are separated with \\r\
$headers = "MIME-Version: 1.0\
$headers .= "Content-type: text/html; charset=iso-8859-1\\r\
// $headers .= "boundary=\\"PHP-alt-".$random_hash."\\"\\r\
$headers .= "X-Priority: 3\\r\
$header .= "Reply-To: No Reply <email@example.com>\\r\
$headers .= "Return-Path:<firstname.lastname@example.org>\\r\
$headers .= "X-MSMail-Priority: Normal\\r\
$headers .= "X-Mailer: php\\r\
$headers .= 'From: ' . $fromname . '<' . $mailfrom . '>' . "\\r\
$subject = "United!";
//$subject = html_entity_decode($subject, ENT_QUOTES);
$message = html_entity_decode($body, ENT_QUOTES);
if(!mail($to, $subject, $message, $headers, "-f $mailfrom"))
echo "Mail is not sent for user id = ".$user_id;
echo "Mail is sent for user id = ".$user_id;
michael_morris1 — 2011-09-28T11:36:20-04:00 — #2
"no-reply" is a spam-bait email address. Other than that I didn't spot anything at a cursory glance. If your server is blacklisted there's nothing you can do short of directly whitelisting. I would recommend using the phpMailer class rather than the native php mail function both for security and to get the headers of the email right, which is difficult.
In brief though there are two ways to be labeled spam. 1, get blacklisted. 2. get a header or two wrong. 2 in testing can cause 1 unfortunately. Spam filters are notoriously fickle, and even Fortune 500 businesses who do bulk emails run afoul of them from time to time.
nofel — 2011-09-28T11:45:43-04:00 — #3
i did tried with subscribe thing too instead of no-reply but didn't work
immerse — 2011-09-28T11:56:29-04:00 — #4
What's in the body of the e-mail?
If there's a lot of HTML, images and little actual content, that might make Google/ Hotmail think it's spam.
If you send it with a plain text body instead, does the mail arrive properly?
jonirvine — 2011-09-28T12:06:16-04:00 — #5
What server is the email being sent on, and has the IP address of that server been blacklisted?
nofel — 2011-09-28T12:09:49-04:00 — #6
Yes i tried but its going in spam.
what should i do:eek:
nofel — 2011-09-28T12:21:37-04:00 — #7
thanks, that was helpful. in many server responses. one came blacklist. the website says 'we notice you are blacklisted'