Computing.Net > Forums > Web Development > PHP Mail problem

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

PHP Mail problem

Reply to Message Icon

Name: chitvan
Date: May 29, 2007 at 05:26:31 Pacific
OS: Linux
CPU/Ram: 256
Product: intel
Comment:

i am sending the following header in the mail

$headers= "MIME-Version: 1.0\n";
$headers.= "Content-Type: text/html; charset=iso-8859-1\n";
$headers.= "From:".$from."\n";

In Gmail I am receiving the message in proper form. but in our server I am receiving it as unnamed [text\html] and I need to download it or open it to see the message.

Kindly please let me know what could be the problem.

Thanks in advance

Chitvan Seth



Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: May 29, 2007 at 06:38:24 Pacific
Reply:

I found the below code in the manual for the mail() function on php.net.

I differences I notice are that it uses a \r at the end of each line and that the "t" in "type" is lower-case. Try those changes and see what happens.

// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

Michael J


0

Response Number 2
Name: chitvan
Date: May 29, 2007 at 23:31:51 Pacific
Reply:

Thanks for the help but this did not worked. With my code i am able to receive the mails in proper format in gmail accounts but as soon as apply "\r\n" instaed of "\n" the mail in gmail also get html tags in it.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: PHP Mail problem

PHP mail www.computing.net/answers/webdevel/php-mail-/3880.html

Prevent form email injection..HOW? www.computing.net/answers/webdevel/prevent-form-email-injectionhow/2077.html

Php form problem (non static) www.computing.net/answers/webdevel/php-form-problem-non-static/1420.html