You are here: Php Email Headers prob « PHP Programming Language « IT news, forums, messages
Php Email Headers prob

Posted by Glenn on 10/25/06 19:02

hello:

I am working through "Beginning PHP5 Web Development", by WROX, and I am
having trouble sending HTML email messages in one application. The email
goes through, but is displayed only as text/plain not text/html.
Here are the headers:

Date: Wed, 25 Oct 2006 14:05:03 -0400
To: XXX@gmail.com
Subject: Please Confirm your postcard
MIME-Version: 1.0
Content-type: multipart/alternative; boundary="==MP_Bound_56gdfg56gd56gg=="
From: no-reply@postcardorama.com
X-vif-MailScanner-Information: Please contact the ISP for more information
X-vif-MailScanner: Found to be clean
X-vif-MailScanner-From: no-reply@postcardorama.com


This is a Multipart Message in MIME format
--==MP_Bound_56gdfg56gd56gg==
Content-type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<html><body>(html)Hello glennsend,

Please click on the link below to confirm that you would like to send this
postcard:

<center><table width="500" border=0 cellpadding="4"><tr><td>Greetings, glenn
rec!</td></tr>
<tr><td>glennsend has sent you a postcard today.<br>Enjoy!<td></tr><tr><td
align="center"><img src="http://localhost/mail/postcards/congrats.gif"
border="o"></td></tr><tr><td align=center></td></tr><tr><td
align=center>Enter your message here:

</td></tr></table></center>

<a href="http://localhost/mail/confirm.php?id=1b55d1414b145e3170f70e111336e437">
Click here to confirm</a></body></html>
--==MP_Bound_56gdfg56gd56gg==
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

(text)Hello glennsend,

Please visit the following URL to confirm your postcard:

http://localhost/mail/confirm.php?id=1b55d1414b145e3170f70e111336e437
--==MP_Bound_56gdfg56gd56gg==--


And the relevant PHP code:

$boundary = "==MP_Bound_56gdfg56gd56gg==";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: multipart/alternative; boundary=\"$boundary\"\r\n";

$message = "This is a Multipart Message in MIME format\n";
$message .= "--$boundary\n";
$message .= "Content-type: text/html; charset=iso-8859-1\n";
$message .= "Content-Transfer-Encoding: quoted-printable\n\n";
$message .= $confirmmessage . "\n";
$message .= "--$boundary\n";
$message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
$message .= "Content-Transfer-Encoding: 7bit\n\n";
$message .= $textconfirm . "\n";
$message .= "--$boundary--";


If someone can tell me why this does not appear as html, I would be most
grateful, as I have been puzzling over this for 2 days now ;(

Glenn

 

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

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