473,394 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Php Email Headers prob

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: XX*@gmail.com
Subject: Please Confirm your postcard
MIME-Version: 1.0
Content-type: multipart/alternative; boundary="==MP_Bound_56gdfg56gd56gg=="
From: no******@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******@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...f70e111336e437
--==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

Oct 25 '06 #1
2 2045
Hi Glenn --

Rearrange the message so that the text portion comes before the HTML.
Sounds really dumb, but it should produce the result you expect.
Geoffrey

Glenn wrote:
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: XX*@gmail.com
Subject: Please Confirm your postcard
MIME-Version: 1.0
Content-type: multipart/alternative; boundary="==MP_Bound_56gdfg56gd56gg=="
From: no******@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******@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...f70e111336e437
--==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
Oct 26 '06 #2
On Wed, 25 Oct 2006 21:18:01 -0700, Geoffrey wrote:

It Worked! Thanks!

I just wonder why the order matters if my email client is set to receive
HTML??
Thanks again!

Glen
Hi Glenn --

Rearrange the message so that the text portion comes before the HTML.
Sounds really dumb, but it should produce the result you expect.
Geoffrey

Glenn wrote:
>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:
<snip>
Oct 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ann | last post by:
Hi, I am trying to send a html email from a php script. This script emails a common information to all the members in the database. The only problem is I cannot specify colors, hyperlinks...
3
by: Dave Smithz | last post by:
Hi there, Previously in my PHP code I was using Sendmail to send out emails to people in the MySQL DB. The requirement cam along to be able to send attachments and so I dug around for an easy...
11
by: Hanjo Grüßner | last post by:
Hello, I'm not shure wether it's OT or not. I want to use an eMail as a trigger to start a program. E.g. an eMail-Group: any group-member sends an eMail to a group-e-adress an the Mail is...
0
by: alanwo | last post by:
Hi Experts, I am trying to send out email and bounce back to different from "FROM" email address: Dim webmail As New System.Net.Mail.MailMessage("B@FROM.com", "ghyddfhg@gmail.com", "hello",...
7
by: geek7 | last post by:
OK, I'm trying to create an email and when it sends the email, it mostly works except that there are '!' inserted at some spots. Checking the html source of the email, looks like they are...
0
by: Ayesharana | last post by:
Hi Every One Actually I am new in C# . so When i try to send email In asp.net with C# then code will execute and Message is shown Email is send . But in actuall There is no Email send to...
4
by: sadieslc | last post by:
I'm working on a PHP script, and the info from the form shows up in the headers of the email that I receive, but it doesn't show up in the body of the email. Can you please help me figure out what...
2
by: Erik Witkop | last post by:
So I have been trying to get this to work all day. I can't get a local file on my web server to attach to an email. Right now I have it printing out in the body of the email. Please help me with...
27
matheussousuke
by: matheussousuke | last post by:
I'm having trouble with e-mail sending, I mean, the website is suposed to send a confirmation email after sign up, but it gets like text plain instead of HTML May someone help me, please? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.