Jump to content

[SOLVED] php mail() and hotmail


freenity

Recommended Posts

Hi guys

And again I'm opening one of the greatest mysteries in the world: how make the mail() function work with hotmail.

I already have a function that sends mails with headers and stuff and it works great with gmail, yahoo, etc AND it worked fine with hotmail just about 6 months ago... now it doesn't. The mails doesn't even go to the spam box.

Anyone could solve this??

I can post my code if it will help...

Thanks for any advise.

Link to comment
https://forums.phpfreaks.com/topic/88424-solved-php-mail-and-hotmail/
Share on other sites

hi, thanks for the reply.

I was looking at the phpbb3 send mail class and I managed to extract how it makes the headers. Now it seems to work fine (the mail arrives, but to the spam box, anyway it isnt so important as the emails from phpbb3 arrive into spam box too), the real problem is that the body of the message isn't shown.

Here is the code I use:

 

sendmail('[email protected]','[email protected]','subject','hi how are you?');

function sendmail($to, $from, $subject, $msg)
{
	$headers = array();

	$headers[] = 'From: ' . $from;

	$headers[] = 'Reply-To: ' . $from;
	$headers[] = 'Return-Path: <[email protected]>';
	$headers[] = 'Sender: <[email protected]>';
	$headers[] = 'MIME-Version: 1.0';
	$headers[] = 'Message-ID: <' . md5(time()) . '@hosting.com>';
	$headers[] = 'Date: ' . date('r', time());
	$headers[] = 'Content-Type: text/plain; charset=UTF-8';
	$headers[] = 'Content-Transfer-Encoding: 8bit'; 

	$headers[] = 'X-Priority: 3';
	$headers[] = 'X-MSMail-Priority: Normal';
	$headers[] = 'X-Mailer: FT';
	$headers[] = 'X-MimeOLE: FT';
	$headers[] = 'X-phpBB-Origin: ' . 'http://hosting.com';

	$headers = implode("\n",$headers);

	if (mail($to, $subject, $msg, $headers))
		return TRUE;
	else
		return FALSE;
}

 

Would apreciate if someone code help with an advise.

hosting.com is replaced with my domain..

Thanks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.