RE: [PHP] Mail and hotmail
| From: | Peter Lauri | Date: | Fri, 05 May 2006 05:24:21 +0000 |
| Subject: | RE: [PHP] Mail and hotmail | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-235612@lists.php.net to get a copy of this message | ||
I do set the headers now, but still the email is not delivered to Hotmail.
This is the headers that I set:
X-Sender: webmaster@dwsasia.com
From: DWS Asia <webmaster@dwsasia.com>
Date: Thu, 04 May 2006 22:04:23 +0700
Subject: What is this? 2
Delivered-to: Markus Karlsson <maka9641@hotmail.com>
MIME-Version: 1.0
Reply-To: DWS Asia <webmaster@dwsasia.com>
Content-type: text/html; charset=utf-8
X-Priority: 3
Importance: 3
Return-Path: DWS Asia <webmaster@dwsasia.com>
X-Mailer: PHP v4.3.11
With this code:
$headers = "X-Sender: ".$this->myFrom."
<".$this->myFromEmail.">".$eol;
$headers .= "From: ".$this->myFrom."
<".$this->myFromEmail.">".$eol;
$headers .= "Date: ".date("r").$eol;
$headers .= "Subject: ".$this->mySubject.$eol;
$headers .= "Delivered-to: ".$this->myTo."
<".$this->myToEmail.">".$eol;
$headers .= "MIME-Version: 1.0".$eol;
$headers .= "Reply-To: ".$this->myFrom."
<".$this->myFromEmail.">".$eol;
$headers .= "Content-type: text/html; charset=utf-8".$eol;
$headers .= "X-Priority: 3".$eol;
$headers .= "Importance: 3".$eol;
$headers .= "Return-Path: ".$this->myFrom."
<".$this->myFromEmail.">".$eol;
$headers .= "X-Mailer: PHP v".phpversion().$eol;
ini_set('sendmail_from', $this->myFromEmail);
mail($this->myToEmail, $this->mySubject, $this->myHTML, $headers);
ini_restore('sendmail_from');
I tried with and without the ini_set.
Best regards,
Peter Lauri
-----Original Message-----
From: Angelo Zanetti [mailto:angelo@zlogic.co.za]
Sent: Thursday, May 04, 2006 5:53 PM
To: Peter Lauri
Cc: php-general@lists.php.net
Subject: Re: [PHP] Mail and hotmail
Peter Lauri wrote:
> Best group member,
>
> I am sending email to a hotmail thru PHP. When I send it like this it
> arrives (in the junk mail, but it arrives):
>
> mail('theaddress@hotmail.com', 'A nice subject', 'Some text');
>
> It works well, but I want to change the FROM header so I do this:
>
> mail('theaddress@hotmail.com', 'A nice subject', 'Some text',
> 'From: Peter
> Lauri <peter@lauri.se>');
>
> This email does not arrive to the Hotmail inbox.
>
>
> If I send to a regular email, like Google Email (gmail) or a regular POP3
it
> arrives without problems.
>
> Anyone who has experienced this problem with sending emails to Hotmail?
And
> how do you solve it?
>
> Best regards,
> Peter Lauri
>
you need to set your mail headers for the mail to be assumed valid,
namely:
X-Sender
From
Date
Subject
Delivered-to
MIME-Version
Reply-To
Content-type
X-Priority
Importance
Return-Path
X-Mailer
HTH
Angelo
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php