Reply to Re: Problem: No headers sent with mail()

Your name:

Reply:


Posted by Ken Robinson on 09/08/05 17:36

Juul wrote:
> Hi,
>
> My hostingprovider just updated to PHP 4.4. Since that time I have problems
> using the mail() function in PHP. I can't send headers anymore and my
> provider don't know what's wrong.
>
>
> Here's a sample script:
>
> if (mail("xxx@xxx.com", "test mail", "This is a <B>test</B>!", "From:
> yyy@yyy.com (yyy)\r\nContent-type: text/html")) {
> print "Sent";
> }
> else {
> print "Not sent";
> }

Had this code worked before?

Try this modification

<?php

if (mail('testemail@example.com', 'Test Mail', 'This is a
<b>test</b>','From: Who Dat <fromemail@example.com>'."\nContent-type:
text/html"))
print 'Sent';
else
print 'Not Sent';

?>

What struck me as a possible problem in your original code was the
'From:' sting. The format "yyy@yyy.com (yyy)" doesn't look right. The
correct way is "Name <email@address.here>"

Ken

[Back to original 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

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