You are here: Re: headers problem in PHP « All PHP « IT news, forums, messages
Re: headers problem in PHP

Posted by Martin Jay on 06/23/06 16:08

In message <1151076561.138962.134270@i40g2000cwc.googlegroups.com>,
glynnjwilliams@googlemail.com writes

> if(mail($to, $subject, $headers, $message, "From: \"$Name\"
><$Email>\nReply-To: \"$Name\" <$Email>\nX-Mailer: chfeedback.php
>2.01"));

>When I remove the two headers:
>
>$headers = "MIME-Version: 1.0\r\n";//for html
>$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
>
>and also the $headers from the mail part of the code it sends fine.

Hiya Glynn. I think you've misunderstand what parameters mail takes.

It should be:

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

In your example you're sending the headers as the message, and the
message as the headers. mail can also take a fifth parameter which is
passed to the program which does the actual sending. You're sending the
additional headers as this fifth parameter which could cause all sorts
of unwanted problems. :(
--
Martin Jay
Phone/SMS: +44 7740 191877
Fax: +44 870 915 2124

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация