• Welcome to Dark Bit Factory & Gravity.
 

HTML in emails

Started by Shockwave, January 07, 2010

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Shockwave

I was shown a visual basic application by a colleague in work today, the application took some values from a microsoft excel spreadsheet and stored them in some strings, it then concatenated them together and sent them to a list of email addresses.

I was asked if it would be possible to apply text formatting to the email and I thought that it would just be a matter of adding html tags inside the strings so we tested it out and the tags were just sent as plain text along with the rest of the email.

I since researched the problem a little online and it appears that it is not as clear cut as I thought.

So my question is (and I don't know if anyone has the answer) : lets pretend I wanted to add the bold tag and the h1 tags to an email and send it in html format using visual basic.. Is there any way to do this?
Shockwave ^ Codigos
Challenge Trophies Won:

rdc

Maybe this will help:

http://mailformat.dan.info/body/html.html

It appears that you need to make sure the header is formatted correctly in order for it to work properly.

benny!

Right, I think if you set the MIME type to text/html it might work.

A general note though:
Keep in mind the variety of mail clients - even if text/html is set
some mail clients won't interpret all HTML tags (correctly). In addition
a lot of users seem to disable the HTML view in mails.

Anyway, Good Luck!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Shockwave

Thanks for the advice.

Bearing in mind that people do disable HTML in emails sometimes, is there a way of displaying and formatting text as rich text instead?
Shockwave ^ Codigos
Challenge Trophies Won:

Jim

There are lots of mime types, I suspect that Outlook would understand text/rtf or application/rtf in the headers along with the html ones.  But I don't think there's a standard that an email client must have except 7bit ascii.

Jim
Challenge Trophies Won:

Shockwave

Shockwave ^ Codigos
Challenge Trophies Won:

benny!

Here is a link as an example of what Outlook 2007 supports
and what not.

http://msdn.microsoft.com/en-us/library/aa338201.aspx

Again, this is just an example of one version of an email client.
Personally, I would try to keep the formatting tags as simple as
possible.

Maybe someone has a intersection list of HTML/CSS which are
supported by all common email clients  ::)
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Shockwave

Changing the header to use text/html was all that was needed to make it work, thanks :)
Shockwave ^ Codigos
Challenge Trophies Won:

Jim

Gotta love the community comments at the bottom of the page that Benny linked to.
Quote
YOU REALLY ARE STUPID!
I didn't know that the latest Outlook replaced IE's html rendering engine with a cut down one.

Great that you got it fixed Shockwave!

Jim
Challenge Trophies Won:

benny!

[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won: