HTML emails

We have just started to send out our confirmation and tracking emails using html instead of txt. This means we can put the email in a more user friendly way and have more information added to it (using a second column) along with a bit of cross promotion to other items. It also means we have a more unified email look.

We have already seen a difference as more users are now using our online help desk (as opposed to just emailing any address) and more users are visiting the areas we cross promote.

I have thought of a potential problem. A few people wont accept html emails. So is there any code I can put into the html email which counters this? So if they wont accept html then the text version is shown. I know it can be done by getting the user to make a choice on checkout, but I would rather have it in the email automatically, instead of having to mess about with the site code.

Thanks
 
it is a website sending out the confirmation? if so then it should be quite possible to add a text only alternative part to the email so that readers without HTML will see a properly formatted text version.

In any case in the majority of cases what will happen is that the HTML version will be stripped of HTML and only the text displayed if there isn't an alternative text as part of the email. This becomes an issue if you have lines like "click here to visit" or graphic content that isn't duplicated as text.

Best to have a plain text alternative for viewing.
 
Upvote 0
Best to have a plain text alternative for viewing.
I know that, but what I want is to have the ability built into the html of the email.

I know there is a way of doing this, I just can't remember how to do it.

it is a website sending out the confirmation? if so then it should be quite possible to add a text only alternative part to the email so that readers without HTML will see a properly formatted text version.
Exactly, but how?
 
Upvote 0

sysops

Free Member
Feb 1, 2007
2,918
885
I know that, but what I want is to have the ability built into the html of the email.

I know there is a way of doing this, I just can't remember how to do it.

Exactly, but how?

It's called a multipart email - you include a plain text part and an html part in the same email. If the email client is configured for html, it will show the html. If it's configured for text only, it will show the plain text part.
 
  • Like
Reactions: Steve2507
Upvote 0
I know that, but what I want is to have the ability built into the html of the email.

I know there is a way of doing this, I just can't remember how to do it.

Exactly, but how?

Well that depends on the programming language of your site and how the emails are sent out now.

Are you developing the site yourself, you you have a web developer who can make the changes you need. From what I remember your using an off-the-shelf ecommerce application. Do you have access to the source code? If it does not already allow this then it is something that needs to be custom built into the application.
 
Upvote 0
The software we use is "off the shelf" but is open sorce and has been extensively modified by me. I am very, very experienced at modifying the code.

The confirmation uses a template email which is populated from the database when needed. So all I need to do is put in the relevant bits at the relevant places for it to work. It's just finding out what the bits are.
 
Upvote 0

sysops

Free Member
Feb 1, 2007
2,918
885
Brilliant, thanks for that.

Any idea on how to code this up?

Sure. You compose your email like this:


In the headers, you include:

Code:
MIME-Version: 1.0
Content-Type: multipart/alternative;
    boundary="b1_85cbac3ba22f0d0e082975afcc9ac70f"
The boundary value is just a long random string you generate.

Then you start your body, like this:

Code:
--b1_85cbac3ba22f0d0e082975afcc9ac70f
Content-Type: text/plain; charset = "ISO-8859-1"
Content-Transfer-Encoding: 7bit
You put your plain text email here. Then you do:

Code:
--b1_85cbac3ba22f0d0e082975afcc9ac70f
Content-Type: text/html; charset = "ISO-8859-1"
Content-Transfer-Encoding: 7bit
And put your html email here.

Then you end your email with:

Code:
--b1_85cbac3ba22f0d0e082975afcc9ac70f--
Make sense?
 
  • Like
Reactions: Steve2507
Upvote 0
Sure. You compose your email like this:


In the headers, you include:

Code:
MIME-Version: 1.0
Content-Type: multipart/alternative;
    boundary="b1_85cbac3ba22f0d0e082975afcc9ac70f"
The boundary value is just a long random string you generate.

Then you start your body, like this:

Code:
--b1_85cbac3ba22f0d0e082975afcc9ac70f
Content-Type: text/plain; charset = "ISO-8859-1"
Content-Transfer-Encoding: 7bit
You put your plain text email here. Then you do:

Code:
--b1_85cbac3ba22f0d0e082975afcc9ac70f
Content-Type: text/html; charset = "ISO-8859-1"
Content-Transfer-Encoding: 7bit
And put your html email here.

Then you end your email with:

Code:
--b1_85cbac3ba22f0d0e082975afcc9ac70f--
Make sense?
Excellent.

Thanks for the help, I shall have a play later.

As to whether it makes sense. It does on the face of it, but like all things IT related the proof will be when I start playing with it.

Thanks again.
 
Upvote 0

TheJollyLabels

Free Member
Mar 7, 2008
22
0
dont forget that when sending html emails, any css must be inline css instead of css from a file, ie if you were trying to style a div instead of doing

<div id="whatever">stuff</div> you'd need to do:

<div style="font-size:12px;">stuff</div> etc etc

as a fair amount of email clients wont let you see the css otherwise
 
Upvote 0

Latest Articles