Detect email client using HTML / CSS - html

I am trying to adjust the content of an HTML email based on the client which is being used to read the email (along with an option to default it to a generic content).
Is it possible using just HTML and CSS (since js will not work with HTML emails) to achieve this ?
I looked for possible ways to do this and found that conditional HTML like can be used to check if client is outlook / lotus.
However, I also want to add checks for gmail and apple mail.
Is it possible using 'media' tags in CSS ?
Appreciate the help :)

Conditional HTML is your best bet to check against various email clients. It really depends on the email client itself, for example, Apple Mail is pretty forgiving with many CSS properties, but GMAIL strips out all CSS in the head. It's a balancing act! Check out caniuse.com to see which properties you can and can't use in email :)

Related

How to validate html email templates?

I am using telerik reporting tool to generate reports in different formats, .pdf,.html, .doc, .txt etc. Some of our client's email server doesn't sport attachment in emails so I want to embed the .html report to my email body instead of attaching it as attachment so user can see report content directly and copy report content. But when I append .html report to the email body it doesn't render in proper format as it was. Is there any online tool or plugin which convert the normal html to email template friendly html? Or how can I validate that this page is going to render fine as email body or not if not then why not? which tag should I remove or replace etc.
I have tried this online tool
but its not working, still got dirty html in email.
There are a couple questions in here, which I will do my best to answer as someone who is comfortable coding emails.
Regarding HTML Email validation, there really isn't a good option.
Since most email clients don’t follow web standards and there are no
email-specific standards in place, properly coded HTML emails will not
pass HTML validating because, if coded properly, nearly all of the
code within an HTML email is likely to be comprised of deprecated
elements.
source
You can use the W3C validator to catch unclosed tags and typos, but that's about it.
But it sounds like you're looking for a tool that converts webpage-friendly html into email-friendly html. Despite both using HTML and CSS, coding emails is quite different from coding the web. Unless the web-friendly HTML design is very basic (say, a series of paragraphs and images), chances are the webpage-friendly html would not bode well in email clients. (Sounds like you've already discovered this.)
Without knowing what these reports look like and what how they should display in email clients, I'm hesitant to give you specific suggestions. I don't know any tools that automatically make 'safe' email markup. If you're open to tweaking the email markup a little, here are a few guidelines:
Keep the design simple.
Use <table>s instead of semantic elements like <div> for layout.
Become familiar with what CSS is and is not safe to use in an email.
I have just found this nice validator (EmailLint - unfortunately hosting has lapsed). There are defined rules for e-mails and you can validate your e-mail against them.

How do you add HTML into an email in Blackberry?

How do you add HTML into an email in Blackberry?
I've tried multipart emails, but that does not seem to work. I am asking how to send an HTML formatted email from an application running on a Blackberry, if I am wording too vaguely, please let me know how to rephrase my question
All HTML emails work the same way - the HTML is in the email body and any images must have a fully-qualified url (http://...).
CSS support is limited and must be defined inline statements (style="") on each element (no stylesheets). Background images are not supported. Tables must be used for layouts (awful but true).
You are talking about the HTML mailers, which are tricky and depend on the client Machine, where they will be eventually seen. Your HTML should be fully table layout based, Styles need to be inline. Below is an HTML mailer that is like almost perfect to display correctly on any device, whether it is MAC or PC or iPad or Blackberry.
http://www.dreamincode.net/iem/display.php?M=2016&C=f945ef50b90408df6b2eb3054df75e79&S=63&L=1&N=25
If you view the source of this page, you would come to know how the mailers need to be build out.
To send the mailers as a mass mailing list you need an Email Marketing Software's.

confusion with the email newsletter

i was trying to get a newsletter done in html . is it mandatory to use while creating a newsletter email template ? what else do I need to take into account to encode the newsletter ?
To get started you can use the templates provided here. When you have some time on your hands go here to understand more about the difficulties associated with creating HTML email.
I think your question is whether you need HTML to make a newsletter. If it's not please ignore my answer.
You don't need to use HTML for your email newsletter, you can just use plain text. However if you want to markup your email newsletter (have colors, images, etc) you do need HTML.
Properly doing HTML-email is difficult. I'm guessing you're not an HTML expert, so I'd advise you to either keep to plain text (which for most purposes is absolutely fine) or use an email newsletter service like MailChimp.
You'll need an application to send your html newsletter from.
http://www.campaignmonitor.com has an easy to use user interface as well as a free trial.

Rules when creating HTML E-Mails?

Is there anything I need to be aware of when creating a HTML e-mail? Is it as simple as creating a valid HTML page then sending it via PHP? Or do I need to use tables to ensure it display's correctly.
Any advice to get this right first time would be much appreciated.
Creating an HTML email that displays the way you want to in email clients, can be very difficult, if not impossible. Unfortunately, email clients do not use the latest and greatest web browsers when displaying emails, and they can also restrict what should be allowed (and with good reasons).
No matter how much you might love CSS-based layouts, table-based layout is still the way to go for HTML emails. You can still use CSS for other things, of course, but in some cases it will need to be inline. The best looking HTML emails I've seen, are largely made up of tables and big images - simply because unlike on normal web pages it is nigh on impossible to create the equivalent using good web development practices. HTML email is a world of its own.
You should also test the emails in as many email clients as you can - and while it can be cumbersome to install all the different clients, you can also use services such as Litmus, MailChimp and CampaignMonitor (see also this question). Personally I have had good experiences with Litmus.
Good luck, creating HTML emails can be quite messy!
Tables are definitely the best option for HTML emails, since most other methods tend to display differently on different machines.
Things to watch out for:
Images are often blocked by email programmes - try to use background colours where possible
Don't link to an external stylesheet - put the styles in <head>. This will prevent your server being hit when the emails are opened.
There's also a good blog post from Mailchimp about using CSS in HTML emails.
Tables is bad...but the correct way to go in emails...
Also send only the part you would normally put in the body and only use inline css.
Another important thing is that background images most of the time dont work.
This is a very good guide that can help you out.
my advice: test in a lot of browsers,mailclients and email programs
You should check out Email on Acid, they not only show you what your email will look like in each client they also analyze your HTML. They highlight the HTML in you code that is not supported in the clients. This tool has saved me hours trying to figure out why an email doesn't render correctly.
One other thing that is very helpful is they provide Tips & Tricks for each client. Anyway you might want to check it out, very helpful.

Should I use HTML 4.0 mark up for my email templates?

A designer coded an html template using CSS best practices. I want to use this template as an email newsletter template, but I've heard people say hotmail, yahoo and gmail offer limited support for CSS.
Am I supposed to re-code these templates using table layouts and font tags?
The short answer is Yes.
You're going to get the best compatibility across webmail accounts & email clients by using the most basic and dumbed down HTML possible.
Don't use any CSS files or <style> tags. Do everything inline.
Handle positioning with nested tables that have explicit widths
I make heavy use of HTML comments in these situations to make sure I don't get confused about where I am in the layout.
All text should be surrounded by <font> tags with the font style information.
Images should have explicit widths & heights.
This helps the email retain its proper layout when images are blocked.
I usually test on a minimum of the following:
Outlook 2003
Outlook 2007
Most of your headaches will come from here.
Thunderbird
Entourage (OSX version of Outlook)
Gmail
Hotmail
Yahoo Mail
You're usually in pretty good shape if you get something that shows up properly on all of those.
We use Exact Target and they have an HTML preview feature but it's not perfect. I've run into a lot of situations where an email looked good in the preview but still came through broken in Outlook 2007.
Mark above said everything that you need to do to develop email templates (it's the 90's all over again), but I wanted to add one last thing:
http://www.email-standards.org/ is a great resource to see how different email clients interpret HTML and CSS.
To build on what Mark said:
If at all possible, avoid using CSS at all (though, it's usually alright for things like text). Use tables for all positioning, empty <td> elements for padding/smaller positioning bits.
And even with all this, it's only going to look perfect in a few email programs/sites. HTML email is, I'm fairly confident in saying, utterly impossible to do in such a way that it shows up perfectly in all mail clients/apps.
You'll have to go back to stone-age HTML to get HTML emails to work out as Mark suggested. All styles inline in the html. No STYLE tags or external stylesheets.
MailChimp and CampaignMonitor both offer excellent free HTML email templates. They also both offer email testing services that send your html emails to several different email clients and then send you screenshots of the results.
use div tag with fixed height/weigth and put all your HTML in there. It would look the same in most clients. Iv'e tried it before and it works fine.