954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

unable to send email to hotmail via php mail()

Hello,

I have been searching far and wide but am yet to find a solution, my php mail sends email to all addresses except hotmail (not weven junk).

Code:

$message = "Welcome to Sky Crew,

Your personal account for the Skye Crew has been created!

Your personal login ID and password are as follows:

userid: ******
password: *****

To log in, proceed to the following address:

http://www.skyecrew.co.za/login.php

Skye Crew Team
";

$headers= "From: Skye Crew<info@skyecrew.co.za>\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "X-Mailer: PHP4\n"; 
$headers .= "Content-Type: text/plain\r\n";
$headers .= "Content-Transfer-Encoding: 8bit\r\n";
$headers .= "Message-ID: \r\n";

mail($_POST['user'],"Your Password for the Skye Crew Website", $message, $headers);


I have tried many different headers, messages and ways to write them yet still no success.

If you have any suggestions or a working php mail script which goes through to hotmail please help me, thank-you.

keanan
Newbie Poster
11 posts since Jul 2008
Reputation Points: 12
Solved Threads: 1
 

Hello, I use class.phpmailer.php . It works for Yahoo, Hotmail, GMail, and I'm sure many others that I haven't tested. It also includes an example which is easy to follow.

buddylee17
Practically a Master Poster
697 posts since Nov 2007
Reputation Points: 232
Solved Threads: 137
 

Thanks for the suggestion - that was the next step I was going to try today. Hope I can get it to work - thank-you.

keanan
Newbie Poster
11 posts since Jul 2008
Reputation Points: 12
Solved Threads: 1
 

Hi Keanan

You can try out this

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: test@abc' . "\r\n";
mail($emailid, 'Test Mail', $message, $headers);
kittu007
Newbie Poster
3 posts since Feb 2008
Reputation Points: 10
Solved Threads: 1
 

Ok tried php mailer and it sends to all accounts except hotmail :(
What can I say hotmail stinks!!!

keanan
Newbie Poster
11 posts since Jul 2008
Reputation Points: 12
Solved Threads: 1
 

Hi Kittu,

Thanks tried the code and about 20 other examples but still no luck with hotmail.

Maybe my isp is blacklisted with them? I dont know, it just seems weird that the emails go to all other accounts I have tested.

$hotmail == 'poo';

keanan
Newbie Poster
11 posts since Jul 2008
Reputation Points: 12
Solved Threads: 1
 

Hi,

I have successfully sent mail to an email address using the following code:

$headers = array ('From' => $from,
	  'To' => $to,
	  'Subject' => $subject);
	$smtp = Mail::factory('smtp',
	  array ('host' => $host,
	    'auth' => true,
	    'username' => $username,
		'password' => $password));

	$mail = $smtp->send($to, $headers, $body);

	if (PEAR::isError($mail)) {
	  echo("<p>" . $mail->getMessage() . "</p>");
	 } else {
	  echo("<p>Message successfully sent!</p>");
davewylie
Newbie Poster
16 posts since Jan 2008
Reputation Points: 10
Solved Threads: 1
 

I'm terribly sorry. I actually use class.smtp.php . I downloaded them both at the same time, got this one to work first, and haven't messed with it in over a year. The script actually has a login and password where you authenticate yourself to your mail exchange and then the email gets sent authentically from your mail exchange with lots of good safe header information that hotmail requires. I've never had a problem getting into hotmail or any other client with this class. It can also send both html and plain text email.

buddylee17
Practically a Master Poster
697 posts since Nov 2007
Reputation Points: 232
Solved Threads: 137
 

hello keanan...
see this link, will help to solve your problem...
http://bestdeveloper.blogspot.com/2008/01/are-getting-spammed-while-sendig-emails.html

Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162
 

Hello,

Thank-you for replying and for your help - I have found the problem.

I used the smtp function in php mailer where I gave authentication etc. and still it didn't work - so i opened another hotmail account to be certain and still had same results.

I then sent an email from webmail to my hotmail accounts (which is the first thing I should have tried - sorry for any inconvenience caused) and the email donot go through - they only go through when replying to a email from hotmail - but unable to send.

So I will speak to our DNS people today as I am now certain it is blacklisted with hotmail.

Sorry to waste your time and thank-you.
;-)

keanan
Newbie Poster
11 posts since Jul 2008
Reputation Points: 12
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You