You are here: PHP Sending HTML Formatted Emails « PHP Programming Language « IT news, forums, messages
PHP Sending HTML Formatted Emails

Posted by robbiesmith79 on 03/19/07 02:24

Just so this is out there on the web, I battled the past 24 hours
about this. Background info... I developed a ecommerce website in PHP
4 on a shared linux hosting plan from GoDaddy and had the html
formatted emails sending as text/html and were going fine with limited
header information. Then we moved the site over to a Dedicated Linux
hosting plan. This time, it's PHP 5. Things are bound to not work as
expected moving to a new programming language.

So what worked in PHP 4:

$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

Now needs to be (at least what worked for me) in PHP 5

$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: php\n";

For the life of me I could not figure out why text/html formatted
emails were always sending as plain text and all the information was
shown in the body text using the PHP 4 method.

There... I hope I have saved someone else the trouble of losing the
amount of hair I did over this.

Rob

 

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

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