HTML email - is this a good example.

Posted on 2009-02-09
Last Modified: 2012-06-27
Hello there.  Could you look at the HTML email  and let me know if you think, in your personal opinion, that the HTMl email is fine.  

By fine I  mean, not bloated with code and will basically be read on most peoples email clients.

The image size is going to come down, a lot.  But just for now I would like to make sure it can be viewed on most clients machines.   The only problem is that the email is just going to consist of an image - so what can I do if users have images blocked?  Should I attach a .txt file with the text on the image?   I have tried looking into sending an MIME, but this is beyond my abilities at present.  

It would help if I could find one single MIME example, or explanatory code, but I cannot.  

I will add a link to a folder which will contain the HTML mailer.   I send the mail by opening in IE > Send by email > Outlook > add subject + recipients > send.

Any feedback would be welcomed.  Thanks.

Zipped folder.
Question by:SpencerKarnovski
    LVL 14

    Expert Comment

    This is just a plain HTML file with one image in it.

    The HTML file has some syntax errors, so try the one attached in the code snippet box below (valid XHTML1.0):
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    <html xmlns="" xml:lang="en" lang="en">
    <title>Title of your Mailing</title>
    <body style="margin: 0px; border: 1px solid black; background-color:#423E24;">
    <table width="100%" cellpadding="10" cellspacing="0">
    <td valign="top" align="left"><img src="" alt="Codex Print List " width="720" height="513" /></td>

    Open in new window


    Author Comment

    Hello Agriesser

    Thanks for you feedback.  I had intentionally left out teh DocType, title etc..   I read somewhere that it over bloats the code.

    Also, do you think its worth investing my time in trying to send a text-based alternative MIME plain text file with this image?  As "some" people may have images turned off?  

    Or would you think that would be a waste of my time?  Should I just attach a plain text file as well?

    Thanks for your input.
    LVL 14

    Expert Comment

    Leaving the DocType out cripples the code, nothing more. When you need to send HTML mails, you should take care about them being valid and a DocType declaration is the first thing you need for valid HTML.

    Besides that, if it's really just the image you're going to send: What's the intended audience for this mail?
    Can you summarize the mail user agents they're using or not?

    External images usually will never be displayed automatically by good MUAs, but there's this "Click to load image" button in those MUAs then so that should not be the problem.

    But, there might be several other problems with this e-mail:
    spamassassin (a popular spam detection software) will assign you quite some scoring points for having an e-mail with just an image and no text in it, so that's what most spammers do. If possible, try to put some text around the image explaining what the recipient is about to read in your mail then chances are higher that people will load the external image.

    Most modern MUAs will also properly display a plain text e-mail with an attached image inline (so for the end user, it looks as if the image is "part" of the mail body and not an attachment).

    But that depends on the MUA the user is using.

    Out of my experience: If you need the e-mail to look exactly the same on all mail user agents, use HTML (for complex layouts and/or images) and if necessary, upload the HTML file to one of your webservers and add a "Read this mail as webpage" link at the top or at the bottom where the user can click on it and read the HTML file in his browser.

    If the HTML is valid and has a good text/image ratio, you will not have problems with spam filters.

    Author Comment

    Hello Agriesser - thanks for the feedback.

    I'm doing this mail for one of my bosses other companies.  Basically I got given that image and asked to make it mailable.   I have expressed that indeed it might be stopped by some spam-filters and do they want to put any text on the page - but they are adamant that they only want this image and the customer base will understand.  

    But I will insist that we put some text above the image saying "click here to view image information" and have that link which takes you to a webpage describing the various printers on the image.

    The target audience is varied I would say, and therefore there will be multiple email clients.  

    But, like I said I will add some text and try to balance the image out to improve chances that the filters will not stop it.

    ~Thanks mate
    LVL 14

    Accepted Solution

    Yes, I know, this will be a problem when the bosses are a bit ignorant about the technical details. I have to face that every second day too :)

    But, there's always text you can include in the mail to make it more spamfilter friendly, even if it's hidden.
    What I personally do is to add a headline at the top with the text from the subject line and at the bottom, add something like:

    This mail was sent at $DATE to $RECPTMAIL.

    For more information, visit our website at

    This is usually enough text for a good image/text ratio.

    Author Comment

    Thanks Agriesser - I did not think about putting some hidden text on the page.  But your suggested text will do fine!

    Thanks a lot.

    Author Comment

    Just one more question.

    I assume the variables $DATE to $RECPTMAIL $YEAR are compiled using PHP - therefore does my whole HTML email have to be saved in .php for them to called when the mail is loaded?

    LVL 14

    Expert Comment

    They were just placeholders for the actual date. If you want to send a bulk mail to 60,000 recipients at once, you can just fill them in with the current date before sending them.

    If you want to send one mail per recipient, you need to think about a way to automate this, either by using some mass mailing software available (as outlook plugin, as windows application, as shell script, etc.) or by doing them all manually, depending on how many recipients there are.

    Author Comment

    Ok, thanks Agriesser - thought for a moment that the actually recipients where being dynamically entered when they click the email - they would be good.

    However, I think we have a staff member somewhere who will be sending the email all day, and adding subjects..  I thought my job was boring! :)

    Thanks for the info!
    LVL 14

    Expert Comment

    That's possible. I'm doing that for all my mass mailing, but I'm using a small script on a linux box for that to happen (you can then even have personalized subjects, greetings, etc.) and much more with just one "click".


    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
    Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now