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

Your name:

Reply:


Posted by Manuel Lemos on 09/09/05 05:07

Hello,

on 09/08/2005 05:17 AM Juul said the following:
> 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";
> }
>
>
> I receive this body-text on xxx@xxx.com:
>
> Content-type: text/html
> Message-Id: <20050908074313.09205430036@xxx.xxx.com>
> Date: Thu, 8 Sep 2005 09:40:02 +0200 (CEST)
>
> This is a <B>test</B>!
>
>
>
> Does anybody know what's going wrong?

Several things seem to be wrong. The line breaks may not be correct. You
should not sent HTML only messages as many mail systems like Hotmail may
simply discard your message. For sending properly compose HTML messages,
you should compose MIME multipart/alternative messaages that include the
HTML part and an alternative text part.

If you don't know how to do that, you may want to try this MIME message
class. Take a look at the test_simple_html_mail_message.php example:

http://www.phpclasses.org/mimemessage


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

[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

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