Author Topic: HTML in emails  (Read 1065 times)

0 Members and 1 Guest are viewing this topic.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 16781
  • Karma: 439
  • evil/good
    • View Profile
    • My Homepage
HTML in emails
« on: January 07, 2010 »


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:

Offline rdc

  • Pentium
  • *****
  • Posts: 1480
  • Karma: 138
    • View Profile
    • Clark Productions
Re: HTML in emails
« Reply #1 on: January 07, 2010 »
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.

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4126
  • Karma: 223
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: HTML in emails
« Reply #2 on: January 07, 2010 »
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:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 16781
  • Karma: 439
  • evil/good
    • View Profile
    • My Homepage
Re: HTML in emails
« Reply #3 on: January 08, 2010 »
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:

Online Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5097
  • Karma: 379
    • View Profile
Re: HTML in emails
« Reply #4 on: January 08, 2010 »
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:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 16781
  • Karma: 439
  • evil/good
    • View Profile
    • My Homepage
Re: HTML in emails
« Reply #5 on: January 08, 2010 »
Ok, cheers Jim.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4126
  • Karma: 223
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: HTML in emails
« Reply #6 on: January 09, 2010 »
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:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 16781
  • Karma: 439
  • evil/good
    • View Profile
    • My Homepage
Re: HTML in emails
« Reply #7 on: January 09, 2010 »
Changing the header to use text/html was all that was needed to make it work, thanks :)
Shockwave ^ Codigos
Challenge Trophies Won:

Online Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5097
  • Karma: 379
    • View Profile
Re: HTML in emails
« Reply #8 on: January 10, 2010 »
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:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4126
  • Karma: 223
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: HTML in emails
« Reply #9 on: January 10, 2010 »
lol ... true...
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won: