Forum Moderators: coopster

Message Too Old, No Replies

Small problem with Mail ()

         

afridy

5:13 pm on Apr 17, 2006 (gmt 0)

10+ Year Member



Hi.

the mails i send using mail() function have 2 problems.

1. The mail send was not HTML formated at the destination.
2. when the user attempt to read the mail, a prompt requesting to send a read receipt.

I think there is somthing wrong with my header inforamton.

here is my header information of the mail.

$headers = "MIME-Version: 1.0\n";
$headers = $headers . "Content-type: text/html; charset=iso-8859-1\n";
$headers = $headers . "X-Priority: 3\n";
$headers = $headers . "X-MSMail-Priority: Normal\n";
$headers = $headers . "X-Mailer: php\n";
$headers = $headers . "From: support@abc.com\n";
$headers = $headers . "Return-Path: support@abc.com\n";
$headers = $headers . "Return-Receipt-To: support@abc.com\n";

Agent matter. Please...

twistedperv

10:58 pm on Apr 17, 2006 (gmt 0)

10+ Year Member



It seems kinda standard around here for people who are trying to help ask a few questions about the question first!

Me Im not all that fluent with the mail() but I managed to squeeze out a really nice script I used for our project manager at work.

Here is what I had for the headers. I wish I could explain to you why yours isnt but maybe this will give you a working alternative.

$subject = "New Comment Posted for $pro_title";
$message = "$message\n\n";
$headers = "From: admin@mydomain.com" . "\r\n" .
"Reply-To: $email" . "\r\n" .
"Content-type: text/html\r\n" .
"X-Mailer: PHP/" . phpversion();

// Default PHP Mail to function
mail($to, $subject, stripslashes($message), $headers);

afridy

2:11 am on Apr 18, 2006 (gmt 0)

10+ Year Member



hai twest pow!

thanks for the feed back.
i got few solutions from other frms too.

Actually the code you have given me is correct.
i have put extra ordinary things in to headers.
thas y the problem came.

thank you for the support.

so. i had to remove the following from my headers.

$headers = $headers . "Return-Receipt-To: support@abc.com\n";

//this what prompt for the read receipet.

$headers = $headers . "Content-type: text/html; charset=iso-8859-1\n";

in this 'charset=iso-8859-1\n' part made the mail plain text. so i had to cut off the part.

now every thing is fine!

twistedperv

10:23 pm on Apr 18, 2006 (gmt 0)

10+ Year Member



awesome! thnx for replying with what the issues were on your code. gave me a little better understanding on it.

Now that I look back over it, the part about why it was requesting a read reciept is obvious (*doh!*) but i didnt know the charset would strip it down to plain text.

Thanx for the info! and "Now I know and knowing is half the battle!" GO JOE! lol