It is theoretically possible to have a converter, that scans the color areas of a bitmap image and creates the same looking image, but using the CSS/HTML. CSS could be controlling colours of pixel-small html blocks. The further optimisation could be done by introducing the larger html blocks with similar color maps.
The resulting markup would be very large, but is it theoretically possible to achieve?
The main goal is to be able to e-mail clients a good looking promotional and informational e-mails, bypassing the problem of 99% of the recipients won't click to enable images in an e-mail. With such HTML-encoded images, a sender is sure that the e-mail looks as expected on the client side.
CSS does not reliably render in email. Bypassing any problems with your theoretical scanner, this is why images are the go-to standard in designed emails.
To see what I mean, look at Campaign Monitor's Guide to CSS support in email.
This would generate so much markup and put such a strain on the rendering engine of the recipient's email client that I don't think it would be viable in practice.
Also I wouldn't trust most email clients to render CSS accurately / reliably.
It is probably theoretically viable (in terms of actually generating the HTMl/CSS), although screen size may be an issue with this (for example divs could get pushed onto the next line whereas in the image they were inline).
Related
I have been tasked with changing some email templates (password resets, etc.). The new templates I have been given are simple, but include a few small images for aesthetic reasons. What are the best practices for including these in emails?
As I understand it, many email providers block images by default due to privacy and tracking concerns (tagging users using unique image URLs for each recipient and waiting for their browser to load the resource). Would using a data URI for images be an effective solution to this issue, or are these blocked too? (And if so, I would love to know why!)
Aside from the fact that really old browsers (IE7-) do not support this format, are there any other reasons not to use it? As far as I understand it, when it comes to email you need to be as simple and transparent as possible, and I worry that doing something a little bit unusual like this could set off alarm bells in the spam filters. Is this concern justified?
Foreground Images (JPG, PNG, GIF) are universally understood in all major email clients. Markup is the same as on a web page (<img src="">). Things like background images, SVG, or data URIs work in some clients but not all, it's best not to rely on these as a way to display essential images. SVG support in email clients.
Some email clients block images by default, but can be downloaded is user clicks a button. Here is a good rundown on image blocking in email clients.
Part of my job involves turning psd designs into html to be emailed out for email campaigns. In the past I've always gone through and converted everything to a suitable html element where possible but I'm now questioning whether there's any point to it?
Is okay just to use one giant image? I only ask because it seems using html elements is only really important if a) I want the information in the email to get to the client if images are blocked and b) for SEO.. yet search engines won't be indexing my code since it's all going through email.
If I'm pretty confident that the clients I'll be mailing won't have the images blocked, is it okay just to treat the entire email body as an <img />?
Thanks
I guess it would be okay, but I wouldn't recommend it. Here are a few reasons why:
The readers won't be able to select and copy any of the content in the email, which in my opinion is really annoying.
You will not be able to have links in your email, the only thing you can link is the entire image.
If they do have images disabled, which i believe is fairly common, the wouldn't see a thing without downloading the image.
Increased email size due to the large image, which for mobile devices is a pain.
An image will not adapt to the window/display size. Text/HTML-based mails can at least break row if the content doesn't fit, to make it more readable.
And the list goes on. The other answers point out a number of additional reasons as well.
I don’t know that there is any definitive answer to this question, but here is my take on it:
I think it’s a good idea to convert certain elements to text so that they can be copied or manipulated. If you have a phone number, you may want that to be readable so that anyone with an automated dialer can click and complete the call. Certain email programs might automatically convert an address to a link to the map. Those features won’t work if any of these elements are flattened into the jpg.
For those mobile email clients that will not render the image on the screen (either because it’s just showing the preview or hasn’t yet downloaded the content) it’s useful to see some of the alternate text (and body content) before viewing the full image.
I know you said that you are sure your clients won’t have images blocked, but you can’t really rely on that. A well-meaning administrator who makes a change to the firewall could accidentally block all incoming images to the entire domain and your email will be worthless.
Lastly, an HTML email with one line of code to load an image has a high possibility of being flagged as spam.
I hope this helps!
What about bandwidth concerns, for users viewing your email on a mobile device? If it's a large image, do you want to blow out their data caps?
Or users using assistive technology, for visually-impaired people. Such as a screenreader(text to speech).The real text is helpful for scenarios like that.
I'm trying to figure out where to put some code in an email. You know how you can get newsletters with styling and images, etc? I wanted to send some out but I cant figure out where to put the code. Do you add the images as attachments? Do you put the code in the body?
or should you upload the .html file as well?
Build the page as a normal HTML page. Use TABLES (yes, TABLES) for your layout. You can use inline CSS, but you cannot use a stylesheet. All images must be fully-qualified (http://yoursite.com/images/). Don't make it wider than about 650 pixels. No JavaScript.
View your newsletter HTML in a browser
Do a select-all, and copy
Paste it into a new message and send it to yourself
See what you end up with
Try other mail clients
Various mail clients will mess with your markup and your styles. What works on Gmail will look like poop on Outlook etc. It will be an exercise in frustration. Test, test, test.
Assume all images will NOT BE SHOWN when the user originally views the email.
Here's a good guide to what works and what doesn't:
http://www.campaignmonitor.com/css/
My advice: keep it simple - a logo and some text and a link to the real newsletter. Making email newsletters is a fine art, and frankly, people prefer to read them in a browser where they behave like a web page.
Sending out HTML emails eigh?
There can be a lot of problems you will quickly encounter, mostly revolving around each email client having their own different way of handling things. The aim here is to keep your email as small, simple, and unbroken as possible.
The message:
Each language has it's own requirements, you need to check with the language you are using to see what is easier, to do it inline as part of the mailing script, or to have it inserted through a HTML file, etc. So for more details here, post the language you're using.
Layout:
This is where message simplicity comes in. The best layouts are usually the most simple ones, especially considering not all email clients are 100% HTML standards compliant. You won't know how big your client's viewing window for the email will be nor can you force it to any size or pop it out. Remember that it's goal is to be a message, not a webpage. Usually simple flexible/elastic tables will do the trick just fine if you have anything more advanced than simple paragraphs.
Images:
Link everything statically (statically means http:\\www. ....mypicture.png as opposed to dynamic linking which looks like this \images\mypicture.png) hosted from your server. The reason for this is so that you will have no broken links, your email will be smaller in size (as opposed to attatching). The downside is that some clients may ask about showing pictures. The cold hard truth is that this cannot be avoided no matter which method you use (See for more details).
Links:
Again, link everything statically. Local/dynamic link's won't work and your recipients will be mighty unhappy.
CSS
Either have your CSS classes at the top, or everything in-line (< ... style="..." />). You don't want to attach a CSS file, it's messy and unconventional.
Scripts
Inline or at the top of your file, for the same reason as above.
Additional Documents
If you want to include PDF's or DOCX's, etc, the best and most common methodology is just like images, to host on your server and simply include a static link in your email to them. It keeps file size down and you don't have to worry about what each and every email browser/reader is going to do.
How do I get html content to stay in relative position and format from one browser/email to another? When developing e-newsletters, the format appears differently in one email server than in another (when testing to two of my emails).
Example: when I open the email in my gmail, the padding around the images is where I want it, but when opening it in my work Outlook, the padding is almost nonexistent.
Example: the font appears according to the style sheet in Outlook, but changes when in gmail.
How can I secure the style sheet and the positioning to keep the appearance constant?
E-mail clients are notoriously terrible at rendering HTML (especially Outlook and Lotus Notes). You will typically be writing crippled HTML with inline CSS styles. This will not get better in the near future.
Make your design as simple as possible, and you will have less trouble making it look right on many clients. The actual best practices for writing HTML will depend mostly on which clients you plan to support.
Some helpful articles that give insight into common solutions for HTML e-mail rendering problems:
Article at A List Apart
Guide at ReachCustomersOnline
There are some easy web services that can check your newsletter on multiple clients and give you screenshots of the results. They are usually worth the money:
Litmus
MailChimp
CampaignMonitor
Do you attach the images?
Use absolute urls?
How do you best avoid getting flagged as spam?
One of the biggest causes, that I have found, for email to be flagged as spam is DNS. Make sure the domain / MX records from which you are sending the email actually resolve correctly back from the server used for sending.
As for images, you could attach them, but the most common way is to host them and use absolute urls. Primarily this is a bandwidth issue - you have to figure you're going to get an open rate of 10 - 15%: if you have to attach all the assets to every email, 85% of the bandwidth you'll use will be wasted.
You attach the emails then reference them in your HTML like so:
<img src="cid:imagefilename.jpg" />
Outlook, at least, recognizes this as a reference to an attached image and dumps it in appropriately.
You'll want to use absolute URLs to link out to images on a server. Users won't want to download your attachments. Also most email clients will not displays images by default, so it's a good idea to keep the really important content as text.
Email clients generally all use very different rendering methods. For example, Outlook 2007 uses Word's HTML rendering engine, whereas previous versions used Internet Explorer.
Do be aware that CSS support is also very limited to in emails. Most clients, especially web mail, will strip out everything outside of the <body> tag, as well as <style> tags. This means that external or embedded CSS will not work, and that inline styles are the safest bet (the style="" attribute). There is also poor support for many CSS rules in Outlook 2007. This means that a lot people have returned to using tables for laying out email.
As it was pointed out, Campaign Monitor is an excellent resource, and I especially recommend their CSS Compatibility Chart
Campaign Monitor is a great resources for html email:
http://www.campaignmonitor.com/resources/#building
Also http://www.email-standards.org/, but seems down right now.