E-mails not sent to hotmail .. Only Gmail & Yahoo accept

the mail() function

Moderators: egami, macek, gesf

Post Reply
User avatar
ameenov
New php-forum User
New php-forum User
Posts: 70
Joined: Mon Jun 13, 2005 2:03 am
Location: Bahrain
Contact:

Sun May 07, 2006 7:57 am

I made a code to script called (Tell a friend).

It is sending emails perfectly but I noticed that it is not sending to hotmail at all .. every time i check my hotmail inbox and junk mail i don't see the e-mails is sent. But gmail and yahoo I always see it in the inbox.

My code

Code: Select all

<?php
session_start();
if (isset($_POST['Submit']) || isset($_POST['name']) || isset($_POST['email']) || isset($_POST['to_email'])) {
/////////////////////////
$_SESSION['name_contact']=$_POST['name']; // set sessins for the name
$_SESSION['email_contact']=$_POST['email']; // set sessins for the your email
$_SESSION['to_email_tell']=$_POST['to_email']; // set sessins for your friend's email
/////////////////////////
if ($_POST['name'] =='') {
echo "please write your name";
} 
elseif ($_POST['email'] =='') {
echo "please write your email";
}
elseif ($_POST['to_email'] =='') {
echo "Please write your friend email";
}
else {
$to_friend = htmlentities(stripslashes(strip_tags($_POST['to_email'])));

/* subject */
$subject = "Invitation to a site";
/* Text */
$body = "the email text here";



/* To send HTML mail, you can set the Content-type header. */
/* additional headers */
   $headers="";
   $headers .= "X-Sender:  {$_POST['name']} <{$_POST['email']}>\n"; // 
   $headers .="From: {$_POST['name']} <{$_POST['email']}>\n";
   $headers .= "Reply-To: {$_POST['name']} <{$_POST['email']}>\n";
   $headers .= "Date: ".date("r")."\n";
   $headers .= "Message-ID: <".date("YmdHis")."b99ja@".$_SERVER['SERVER_NAME'].">\n";
   $headers .= "Subject: $subject\n"; // subject write here
   $headers .= "Return-Path: {$_POST['name']} <{$_POST['email']}>\n";
   $headers .= "Delivered-to: {$_POST['name']} <{$_POST['email']}>\n";
   $headers .= "MIME-Version: 1.0\n";
   $headers .= "Content-type: text/html;charset=windows-1256\n";
   $headers .= "X-Priority: 1\n";
   $headers .= "Importance: High\n";
   $headers .= "X-MSMail-Priority: High\n";
   $headers .= "X-Mailer: b99ja Mailler With PHP!\n";

//send
/////
if (mail("$to_friend", $subject, "$body", $headers)) {
echo "Your mail sent";
unset($_SESSION['name_contact']);
unset($_SESSION['email_contact']);
unset($_SESSION['to_email_tell']);
} else {echo "Your mail did not sent";} // END if not send show this message
} // END ELSE conditioning
} // END isset conditioning
?>
I don't know if it is from my coding or from hotmail
Last edited by ameenov on Mon May 08, 2006 2:19 am, edited 3 times in total.
Don't give me a fish but teach me how to catch it (:

Coditor
New php-forum User
New php-forum User
Posts: 243
Joined: Wed Feb 01, 2006 9:18 am
Location: Netherlands
Contact:

Mon May 08, 2006 12:06 am

There's a good chance a spamfilter is blocking the email.

Things like high-priority headers are counted as "possible spam" tags. If an email contains too many "possible spam" tags and/or keywords, it may be blocked. A different level may have been set for sending the mail to the junk folder than for actually deleting the email.

The subject also suggests spam, as does the length of the body. Try a different subject line and add some more content to the body. Then try again.

You might try to ask Hotmail why your email is blocked (send them a sample) but I doubt they will assist you because it breaks the point of having a spamfilter.

Coditor

User avatar
gesf
Moderator
Moderator
Posts: 1716
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Tue May 09, 2006 1:27 am

Also make sure your sending to the right email address. Make it all once... use CC "field".
Sincerely,
Gonçalo "gesf" Fontoura

gesf.org | sessionstart.com | urlms.com

User avatar
ameenov
New php-forum User
New php-forum User
Posts: 70
Joined: Mon Jun 13, 2005 2:03 am
Location: Bahrain
Contact:

Tue May 09, 2006 10:05 pm

Thanks for your replies but i tried your solutions but no chance to get it work :( ..
Now i searching for a code that sends emails to hotmail in anyway even if i get it going to the junk mail
Don't give me a fish but teach me how to catch it (:

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests