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
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('anotheremail@hotmail.com','myemail@gmail.com','subject','hi how are you?');

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

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

	$headers[] = 'Reply-To: ' . $from;
	$headers[] = 'Return-Path: <hosting@hosting.com>';
	$headers[] = 'Sender: <hosting@hosting.com>';
	$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.

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.