Web Hosting Talk







View Full Version : PHP HTML-email issue


northcloud
02-15-2005, 10:31 PM
Hello everyone,
In the project I am working on, after a new user registred, we need to send a confirm email to user with an active link embeded (just like the way to register in www.webhostingtalk.com). I got problem to finish this. The user can received the email, but this email is without body, only with From, To, Subject. Does anyone can help me figuring out what's wrong with it? I appreciated any advices.

The email header I sent is below:
From: newaccount@totalhroffice.com
MIME-Version: 1.0
Content-Type: multipart/alternative;

boundary="----=_NextPart_000_0041_01C011A0.6BB8DA10----"

Content-Transfer-Encoding: 7bit

The email body is below (things between 2 star lines):
************************************
This is a multi-part message in MIME format.

----=_NextPart_000_0041_01C011A0.6BB8DA10----
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Dear a111111,

The following is your login information for www.TotalHROffice.com.
...........

----=_NextPart_000_0041_01C011A0.6BB8DA10----
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit


<html>
<head>
<title>Welcome to Total HR Office</title>
</head>
<body><p>Dear a111111 ,</p>
<p>Welcome to Total HR Office, a service of HRinterax, Inc.!聽 We have received your registration and your account is now online.</p>
<p>HRinterax, Inc. has worked hard to earn the trust of customers across the nation and we are confident that we will earn yours.聽 If at any time you would like to offer any suggestions or ideas on how we can improve the service you are receiving, please contact us at: <a href="mailto:comments@totalhroffice.com">comments@totalhroffice.com</a>.</p>

Please note - you must complete this last step to become a registered member.
You will only need to click on the link once, and your account will be updated. <br><p>
To complete your registration, click on the link below:<br>
<a href=\"http://www.totalhroffice.com/member_activate.php?username=a111111&amp;usermail=northcloud2000@yahoo.com\">Click here to activate your account</a><p>
<p>Thank you for choosing Total HR Office - The Cure for HR Headaches!</p>
<br />
<p>Your Total HR Support Team<br />
HRinterax, Inc.</p></body></html>
----=_NextPart_000_0041_01C011A0.6BB8DA10----
***************************************************

The PHP version on the server is 4.3.2 and Apache is 2

Thanks

mitchlrm
02-16-2005, 02:02 AM
The boundries you've setup are incorrect.

The boundries need to be preceeded by "--" so your boundries should be ------=_NextPart_000_0041_01C011A0.6BB8DA10----

The ending boundry needs to be followed by "--".

Mitch

northcloud
02-16-2005, 11:39 PM
Thanks, Mitch. I fix the bounderies like you said. It works with some condition. I have 2 sites. One for testing and another is a real running site. They are hosted in different sites (testing site uses a share-hosting, and real one runs on a dedicated server). The email function works on my testing site well, but still doesn't work on the real site (without boby, but with From/To/Subject). Could you give me more advices about it? Thanks again.

Chen

Now my email body look like below:
********************************************************
This is a multi-part message in MIME format.

------=_NextPart_000_0041_01C011A0.6BB8DA10
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Dear a222222,

The following is your login information for www.TotalHROffice.com.
.......

------=_NextPart_000_0041_01C011A0.6BB8DA10
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit


<html>
<head>
<title>Welcome to HR411.com</title>
</head>
<body><p>Dear a222222,</p>
<p>Welcome to HR411, a service of HRinterax, Inc.?We have received your registration and your account is now online.</p>
.....

<p>Your HR411 Support Team<br />
HRinterax, Inc.</p></body></html>
------=_NextPart_000_0041_01C011A0.6BB8DA10--
*********************************************************

And email header looks like this:
**************************************************************
From: newaccount@totalhroffice.com
MIME-Version: 1.0
Content-Type: multipart/alternative;

boundary="----=_NextPart_000_0041_01C011A0.6BB8DA10"
***************************************************************

mitchlrm
02-17-2005, 12:18 AM
I'm afraid I can't be of much help here. You probably need to determine how the dedicated server is setup. It may be using a different mail program or different parameters.

Mitch

northcloud
02-17-2005, 10:51 AM
No problem. Thanks again.