473,727 Members | 1,988 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_56gdfg56g d56gg=="
From: no******@postca rdorama.com
X-vif-MailScanner-Information: Please contact the ISP for more information
X-vif-MailScanner: Found to be clean
X-vif-MailScanner-From: no******@postca rdorama.com
This is a Multipart Message in MIME format
--==MP_Bound_56gd fg56gd56gg==
Content-type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

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

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

<center><tabl e width="500" border=0 cellpadding="4" ><tr><td>Greeti ngs, glenn
rec!</td></tr>
<tr><td>glennse nd 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>En ter your message here:

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

<a href="http://localhost/mail/confirm.php?id= 1b55d1414b145e3 170f70e111336e4 37">
Click here to confirm</a></body></html>
--==MP_Bound_56gd fg56gd56gg==
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_56gd fg56gd56gg==--
And the relevant PHP code:

$boundary = "==MP_Bound_56g dfg56gd56gg==";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: multipart/alternative; boundary=\"$bou ndary\"\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 2061
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_56gdfg56g d56gg=="
From: no******@postca rdorama.com
X-vif-MailScanner-Information: Please contact the ISP for more information
X-vif-MailScanner: Found to be clean
X-vif-MailScanner-From: no******@postca rdorama.com
This is a Multipart Message in MIME format
--==MP_Bound_56gd fg56gd56gg==
Content-type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

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

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

<center><tabl e width="500" border=0 cellpadding="4" ><tr><td>Greeti ngs, glenn
rec!</td></tr>
<tr><td>glennse nd 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>En ter your message here:

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

<a href="http://localhost/mail/confirm.php?id= 1b55d1414b145e3 170f70e111336e4 37">
Click here to confirm</a></body></html>
--==MP_Bound_56gd fg56gd56gg==
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_56gd fg56gd56gg==--
And the relevant PHP code:

$boundary = "==MP_Bound_56g dfg56gd56gg==";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: multipart/alternative; boundary=\"$bou ndary\"\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
4341
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 etc..Html tags like <h1></h1>, <br/>, <b> etc works though.. Could any one tell me what i might be doing wrong? Any help will be greatly appreciated.
3
1676
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 bit of code that did not need classes and I could plug easily into my PHP code. I thought I found one (see bottom of email), however I have since discovered that as it is, this script has the following disadvantages when compared to using...
11
2456
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 dispatches automatically to all members. I know there are services like yahougroups who do exactly this, but I
0
874
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", "return errors to") 'webmail.Headers.Add("Errors-To", "a1@a1.com") 'webmail.Headers.Add("X-Sender", "a1@a1.com") webmail.Headers.Add("Sender", "a1@a1.com")
7
3557
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 placed at the end of long lines. I'm assuming there is some issue with the encoding, but searching through groups, nothing I've tried has worked. Can someone let me know if I should be doing something differently with my headers for an html email?...
0
1064
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 Specified Email Addres. so wat a prob with Email sending In asp.net . Why it is not Normally working is there SMTP server prob ... plz help me or guide me some Goood website regarding Sending Email In Asp.net +C# Thank you
4
1849
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 I'm doing wrong? Here is the script: <? function send_mail($emailaddress, $fromaddress, $emailsubject, $body) { $eol="\r\n"; $mime_boundary=md5(time()); # Common Headers
2
4287
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 any thouhgts on how to get it in as an attachment. CODE: <?php ini_set(SMTP, "172.18.1.65");
27
4936
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? Here's the code <?php require_once 'path_cnfg.php';
0
8891
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9260
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9185
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9120
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4521
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4786
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.