Forum Moderators: coopster

Message Too Old, No Replies

Php mail()

         

theriddla1019

4:39 pm on Oct 14, 2004 (gmt 0)

10+ Year Member



Does anyone know any good links on proper syntax and mail setup so i can mail to hotmail aol etc? I can send them to my mailserver no problem and to gmail, but not to hotmail or aol.

Timotheos

5:44 pm on Oct 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



More then likely it's in the hotmail's junk mail folder.

Lot of talk on this subject
[webmasterworld.com...]

Here's a php mail header example
[webmasterworld.com...]

theriddla1019

6:59 pm on Oct 14, 2004 (gmt 0)

10+ Year Member



I took a look at those links and i got one mailer off my list. I can get through to aol now, but hotmail is still dropping my emails. And not even putting it in spam folder.

this is my sendmail page...

<?
$to = "(#*$!xx)@hotmail.com";
$subject = "Question from " . $name;
$headers = "From: ".$name."<".$email.">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "Reply-To: Adam <(#*$!xx)@hotmail.com>\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: Q & A (#*$!xx)online.";

mail($to, $subject, $message, $headers);
?>

(#*$!xx) = Deleted Text

theriddla1019

7:42 pm on Oct 14, 2004 (gmt 0)

10+ Year Member



Now trying:
<?
$to = "_______@hotmail.com";
$subject = "Question from " . $name;
$headers = "From: ".$name."<".$email.">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "Reply-To: Adam <_______.com>\n";
$headers .= "Return-Path: _______.com\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: Microsoft Office Outlook, Build 11.0.5510\n";
$headers .= "X-Sender: _______.com\n";
$headers .= "X-AntiAbuse: This is a solicited email for - _______Online mailing list.\n";
$headers .= "X-AntiAbuse: Servername - {$_SERVER['SERVER_NAME']}\n";
$headers .= "X-AntiAbuse: User - _______.com";

mail($to, $subject, $message, $headers);
?>

Still no go on hotmail...

Timotheos

7:48 pm on Oct 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You sure that you're not blacklisted [spews.org]?
See also [webmasterworld.com...]

I use a very very simple header and it gets through to both hotmail and aol.
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=utf-8\r\n";
$headers .= "From: Me Timotheos <me@example.com>\r\n";

theriddla1019

7:52 pm on Oct 14, 2004 (gmt 0)

10+ Year Member



Im 99.9% positive our domain wouldnt be blacklisted. We promote services through actual paper mail-outs and fax-outs. We dont plan on doing any type of mailing over the internet.

Just checked spews and domain not listed.

theriddla1019

8:01 pm on Oct 14, 2004 (gmt 0)

10+ Year Member



Bigger is not better, your header is perfect works like a charm!
Thanx!
Adam

coopster

9:34 pm on Oct 14, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



20 to 1 says it was the CRLF issue again.
$headers .= "Content-type: text/html; charset=iso-8859-1\n"; 
versus
$headers .= "Content-type: text/html; charset=utf-8\r\n";

Timotheos

11:23 pm on Oct 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Coopster, you a gambling man?

Why would that matter with hotmail and not with gmail? In my experience the \n vs \r\n problem just stops all mail from being sent.

jatar_k

4:13 am on Oct 15, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



not true Timotheos

if your mail server doesnt care but the recipient mail server does the mail will be sent with proper headers and arrive with malformed ones.

I have had that problem, as I always say, I hate email.

Timotheos

5:01 am on Oct 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So riddla, we need you to do a test for us and change the \r\n back to \n with the simple header.

coopster

12:52 pm on Oct 15, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



The Gambler he broke even...

Fun issue, no doubt. ergophobe started a thread regarding mail() and CRLF vs LF [webmasterworld.com] that never really got legs; it would be great to see it revived with some lively discussion and input from others...

...Timotheos, maybe we'll find an ace that you can keep ;-)

theriddla1019

9:26 pm on Oct 18, 2004 (gmt 0)

10+ Year Member



Changed them back to \n and no go.
Mails to gmail and not hotmail.
Other way around \r\n mails to both.

Timotheos

10:12 pm on Oct 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Very cool. Thanks riddla.

Coopster is right again... as expected ;-)

theriddla1019

2:51 pm on Oct 19, 2004 (gmt 0)

10+ Year Member



Its kinda funny that that was the reason it wouldnt go through. I searched through hundreds of php mail functions and they all stated If you are running php off a netware server(which i do) dont use /r because it will automatically place it there and if you put it there it will double it up and mess up your headers. So i thought since gmail was going through that the headers were being sent correctly. This is one screwy topic. But thanks none the less for sending me down the right path :)