View Full Version : HTML E-mails
Danny
March 14th, 2005, 23:06
Hey,
Does anyone know how i can get a html file to work as an e-mail,
i followed a tutorial from SitePoint, and all the css is included on the one file, but the MS Outlook seems to be ignoring all of the css?
Can anyone help, give me a shout and i will e-mail the messup thing to you!
the_pm
March 14th, 2005, 23:16
HTML email is touchy, because there are so many different programs interpreting your markup, and they are way worse than browsers at doing it.
Last I checked, you could forget about using CSS in an email if you wanted it to be readable in Outlook Exchange (the online outlook interface). Hotmail is notorious for not being able to change text colors, though it will change background colors just fine. Let me tell you how shocking it was to find THAT out! The only good thing about online Web mail services is if they do update their ability to read HTML, everyone is automatically updated - you don't have to worry about past versions (maybe that Hotmail problem is already fixed).
An HTML email from me looks like it was coded back in 1998. It's valid, but it's not pretty. And it always has a comment at the top with a link leading people to an online version of the email, in case they only receive the markup.
Danny
March 14th, 2005, 23:20
I see, so whats the best way at displaying an e-mail for design purposes?
-alb-
March 15th, 2005, 04:38
I have found that basic is always better and that tables are still the way to go as far as this is concerned. Get yourself back in an old school mindset and knock the dust off of the <font> tag, because that is still the best way to reach the most people when you are talking HTML formatted email.
Some email programs have a hard time with CSS for whatever reason. Sometimes it is because the CSS gets skipped over because of the extra lines of code that automatically get inserted before the tag.
Although I have only done it a few times, I found it easiest to look at HTML email that Am Ex or Discover sends and see how they did it. Also, Microsoft has some decent looking HTML formatted email.
Hope this helps.
the_pm
March 15th, 2005, 04:55
Correcto, alb - good advice and not the easiest to follow. It's sad, but true. You're going to have to dig deep into HTML history to make this work consistently. Check a spec for HTML3.2 - that oughta do the trick ;)
inimino
March 16th, 2005, 07:08
Actually the best thing here is to reconsider altogether.
Frankly HTML email is an abomination and implementations of it are responsible for numerous security issues, and I'm not talking about just code execution through MUA bugs. Much of the phishing issue and a lot of spam would evaporate overnight without HTML mail.
Email was designed as text and should stay that way.
Almost all HTML mail has a direct channel to my trashbox.
So the question is, what are you sending that simply can't be communicated as a legitimate plain text email?
Anoop
March 16th, 2005, 20:47
I have used PHP to send mails in HTML format. Usually outlook shows some problems interpreting the html mails. But we can get it worked by setting the headers correctly.
Even a space between \r and \n in the headers will cause problem (It is very difficult to figure out such problems). I think we can use styles also.
BigBison
March 18th, 2005, 06:56
I like HTML E-mails! Abomination? I'm astounded, inimino! ;) Web developers shouldn't overlook this opportunity for additional revenue from the image-conscious client. I always sign up for the HTML version of newsletters and such, if possible.
If I'm expecting it, it won't end up in the spam filter. Good code won't either, the HTML cues the spam filters use are things like FONT tags, not modern CSS layouts. I use "VisualOffice" webmail, which renders HTML e-mail impeccably.
inimino
March 18th, 2005, 19:15
HTML emails use more bandwidth, they are always twice as big and usually much more.
Web bugs can be used to track who opens them, and bugs in HTML rendering code are responsible for numerous security holes in email clients.
Phishing emails routinely use links like <a href="spamerrs-r-us.com">http://www.respected-business.com/</a> and most users are not even aware of that possibility. Of course all kinds of techniques can be used to get key words past spam filters.
Rarely is anything sent in HTML mail that can't be expressed just as well in plain text. If there was a compelling need for it, then it would be worth weighing the risks.
The security issues alone of HTML are reason enough not to send or receive it. Between spam, virus propagation, and privacy violations, the costs of HTML mail to end-users are significant.
Not to mention usability issues -- the formatting that many people so dearly love when they are creating it, just means that instead of seeing email the way they want to see it, your readers end up seeing what you wanted them to see. If I'm reading a dozen emails in the morning, do I really want my eyes to have to adjust to a new font, background color, etc on each one of them? Or would I rather see them all exactly the same - in the font I find most readable?
Of course this is an issue that has been flogged to death many times before so it's unlikely that either of us will convince the other. At least this is not Usenet, so we can have this discussion in peace. ;-)
As it is, the fundamental idea of email is that you establish a dropbox where anyone in the world can anonymously dump anything at all, and then you agree to sort through it all. The utility or sanity of that approach is debatable, but at least putting some sort of filter on that incoming flood of content makes it a little more manageable. So the criteria for what is acceptable in an email must be different from the criteria we use on the Web, for example.
Text email is very simple to understand. What you see is all you get. Nothing is hidden, nothing is wasted. Understandable technology makes the world a better place.
Danny
March 21st, 2005, 14:10
inimino, thanks!
You have pointed a few things out that i hadnt even bothered to think about !
Cheers,
vBulletin® v3.6.8, Copyright ©2000-2010, Jelsoft Enterprises Ltd.