|
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
Navigation:
[Reply to this message]
|