By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,722 Members | 1,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,722 IT Pros & Developers. It's quick & easy.

Why does HTML email appear normally sometimmes, and sometimes not?

P: n/a
Hello,
I have signed up a for a Google Gmail account. I sent myself some
PHP-generated HTML emails from two different machines using this code:

$to = "da**@gmail.com";
$id = 1234;
$from = "se****@suppressed.com";
$headers = "MIME-Version: 1.0\r\n"
. "Content-type: text/html;
charset=iso-8859-1\r\n"
. "Content-Transfer-Encoding:
7bit\r\n"
. "From: $from\r\n"
. "X-Mailer: PHP " . phpversion() .
"\r\n"
. "Reply-to: $from";
$body = "<html><head></head><body><a
href='cbssportsline.com'>Link</a><BR><b>Hello</b></body></html>";

if (!mail($to, "hello", $body, $headers)) {
die("Email delivery to $to
failed.\n");
} // if

When I send the email from my dev box, the HTML displays normally on
Gmail. However, when I upload the same code to my hosting company and
send an email, I open my gmail email and there's no HTML formatting
whatsoever. Here's what I see:

Content-type: text/html; charset=iso-8859-1

Content-Transfer-Encoding: 7bit

From: se****@suppressed.com
X-Mailer: PHP 4.3.9

Reply-to: se****@suppressed.com

<html><head></head><body><a
href='cbssportsline.com'>Link</a><BR><b>Hello</b></body></html>

The sender reads "(unknown sender)". Why do I see HTML-formatted
text some times and not others? How should I go about debugging this
problem?

Thanks for your help, - Dave
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hello,

On 10/25/2004 10:14 AM, D. Alvarado wrote:
When I send the email from my dev box, the HTML displays normally on
Gmail. However, when I upload the same code to my hosting company and
send an email, I open my gmail email and there's no HTML formatting
whatsoever. Here's what I see:


That looks like one of the mail function bugs.

You may want to try this class that implements workarounds for some of
the problems. It also lets you compose and send HTML messages properly.
The way you did it may lead to messages never arriving for instance to
Hotmail accounts and other places.

http://www.phpclasses.org/mimemessage
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #2

P: n/a
Do not send HTML email. Period.
Jul 17 '05 #3

P: n/a
sending html email is fine
it's a standard now. (thank heck MS rtf is falling out)
newsgroups are plain text, and email is html. Too common to just "not do it"
imho

"Brandon Blackmoor" <bb********@blackgate.net> wrote in message
news:2u*************@uni-berlin.de...
Do not send HTML email. Period.

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.