473,394 Members | 2,160 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.

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

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
3 2230
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
Do not send HTML email. Period.
Jul 17 '05 #3
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: ian justice | last post by:
Before i post actual code, as i need a speedyish reply. Can i first ask if anyone knows off the top of their head, if there is a likely obvious cause to the following problem. For the moment i've...
3
by: Ed Brandmark | last post by:
I have a tag of the form <SCRIPT LANGUAGE="JavaScript1.1" SRC="foo.js"..... and was wondering if this delays the loading of my page until that file foo.js downloads. It seems that if I place...
11
by: Saqib Ali | last post by:
Please excuse me, this is a fairly involved question that will likely require you to save the file below to a file and open it in a browser. I use Mozilla 1.5, so the problem I describe below...
12
by: Philipp Lenssen | last post by:
I would like to get feedback on any industry eBook standards vs using plain HTML (along with some server-side scripting). I believe HTML is suited to display books, but I might be missing...
2
by: je | last post by:
Slightly newbie question: I have some XML to be transformed which contains (inter alia) tags containing text: <tag>Foo</tag> which sould appear unchanged in the transformed output. Using xopy-of...
11
by: Brian W | last post by:
Yet another editor problem To reproduce do the following 1) Open a Webform and switch to HTML edit mode 2) Enter the Following (include spaces) This is some text before <asp:hyperlink...
10
by: paulie | last post by:
Hi, I have been experiencing an issue when trying to use AJAX to reload a DIV area using a timer of 2000ms, which contains a html page with another DIV and javascript. Scenario -------------...
2
by: javelin | last post by:
I support a website. When we send HTML emails from out system, we generate a variable called "str". We set that str variable to the objMail.htmlbody property of the mail object. Frequently, random...
6
by: =?Utf-8?B?TMOhemFybw==?= | last post by:
Hi everyone I've a simple ASP.NET Page that send a email using smtclient. The server is a Exchange and use my credentials to autentificated. The problem is that the send mail appear in the...
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:
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
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.