Questions tagged [html-email]

HTML used to format emails (message content, not email addesses)

Although the HTML used to format emails is the same as that used to create web pages, it has a different set of problems and best practices.

Code Validation

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 depreciated elements.

Client Code Compatibility

In working with HTML emails, much of the functionality possible in typical web development is not possible in email. Good practice, is to restrict code usage to that which is XHTML1.0 compliant. Recent upgrades to many platforms have allowed for some loosening of that restriction and it is now common for people to use the HTML4.0 compliance standard.

DOCTYPE

The recommended doctype for HTML email is XHTML 1.0 Strict. The reason for this is because, regardless of any alternative doctype definition, Gmail will impose XHTML 1.0 Strict regardless and of the two clients which impose their own doctype, Gmail has the largest percentage of users so it is only logical to confirm to the standard that will be imposed whether you like it or not.


Below is a list of Email Clients and Their Treatment of !DOCTYPE as well as expected results.

STRIP or IGNORE your DOCTYPE entirely:

  • AOL
  • Android Gmail Application
  • Lotus Notes 6.5, 7, 8 and 8.5
  • Outlook 2007 and 2010
  • Thunderbird 2 and 3
  • Yahoo

    Results:

    • Box model padding becomes an issue when viewing your email in IE vs Firefox
    • In IE 8, CSS padding on TABLEs are reset to “0″ – for example:
    • Center tags with a set width will no longer be centered in all browsers except IE. For example:
    • In IE, the minimum height on any EMPTY block element is 19px This is particularly important when using spacer divs.
    • In all browsers except for IE 6 and 7, paragraph elements have a default top and bottom margin of “0″ whereas it would otherwise use a default top and bottom margin of 16px.
    • In IE 8, you might see an exaggerated left margin on OLs and ULs, you will need to define the margins with inline CSS to correct this.
    • Some special characters are not supported

ACCEPT your DOCTYPE

  • Android Mail Client
  • Entourage 04 and 08
  • iPad and iPad Gmail
  • iPhone and iPhone Gmail (iOS3 & iOS4)
  • Kindle Fire
  • Live Mail
  • Outlook 2003
  • Outlook Express
  • Thunderbird 6
  • Windows Mail

Impose Their Own Standards

  • XHTML 1.0 Strict – Gmail & Hotmail

    Results:

    • Line height for small fonts may become more prevalent in all browsers except for IE. This is only an issue when using inline elements, use paragraph elements or TDs for formatting your small fonts.
    • You might see a small space below each of your images. A common fix is to useinside your image tag.
    • Some special characters are not supported
    • There may be a difference in the way your text links appear (colored underlines)
  • Yahoo Classic – HTML 4.01 Transitional

Mailchimp KB

SlideShare

SixRevisions guideline

5038 questions
1
vote
1 answer

@font-face not working in html email

I am trying to use a custom font in a newsletter/html email. I got the @font-face import working in safari, firefox and chrome, but as soon as I try to use it in an email client (tested with apple mail, thunderbird and gmail) the custom font is not…
Tobias Grunwald
  • 161
  • 1
  • 3
  • 14
1
vote
1 answer

How to insert a deep link on html email

I'm sending an HTML email with some informations for the user, however I want to make a deep link for an app. I tried to make something like this:

Abrir Meu Diário

But when I send the email…
Felipe Augusto
  • 7,733
  • 10
  • 39
  • 73
1
vote
2 answers

How to send HTML Emails in Outlook.com

I need help creating an HTML Email in Outlook.com. I looked in the settings and didn't see any information for this. I also searched online and in other Stackoverflow questions but couldn't really find the answer. My email is pretty simple, but each…
Reisol
  • 11
  • 4
1
vote
1 answer

HTML for Email - Change position in CSS doesn't Work

This is my first time coding HTML for e-mail. I saw some tutorials to guide me, but I'm having a problem that I don't know how I can fix it. Basically. all my code is inside of s. At the end of the page, the footer is also a
. But it…
olegario
  • 711
  • 2
  • 16
  • 35
1
vote
0 answers

'Responsive' email not responsive post-my interference

Apologies in advance for code overkill. I don't have any idea where the problem lies, so I'm just going to have to paste in the whole thing. I don't think what I've been trying to build is particularly complex- but I AM now particularly out of my…
1
vote
1 answer

Tracking pixel in Outlook 2007

i have problem with tracking pixel in mso, when i send my campain to gmail it shows and track correctly, but in mso it doesn't show(shows like red x). I found some topics here, but there isn't solution. Every topic say to set mso to force images.…
1
vote
4 answers

PHPMailer html email not displaying as html

We have an email system where an email is formatted via PHPMailer. When PHPMailer sends the email, I open it in the email client and it displays as text not HTML. I have tried using Gmail and Yahoo - both clients display the email as the HTML source…
hinch
  • 91
  • 2
  • 12
1
vote
2 answers

HTML Email Validation?

I guess this is a standards question and not a specific coding question. I wanted to know if I needed to validate the HTML with something like W3C HTML Validation? If I send the DOCTYPE and META tags in the HTML email it doesn't render the HTML in…
Phill Pafford
  • 83,471
  • 91
  • 263
  • 383
1
vote
1 answer

Why is there a line break in my email preview text in iOS Mail app?

I have created a few HTML emails using Foundation for Emails. I am seeing a strange behavior in the iOS Mail app consistently with every email I create. The preview text has a line break in it for some reason. Here's what I mean: Instead of showing…
flyingL123
  • 7,686
  • 11
  • 66
  • 135
1
vote
1 answer

Formatting String within Variable PHP

Is it possible to format the string within a variable within PHP script. The following script sends an email to the user. The part shown is my entire body of the email including my signature. I want to bold or change the font size of my signature…
1
vote
3 answers

HTML email doesn't showing properly in Gmail

I am sending a HTML email and getting different results in gmail. This is what I'm getting on gmail, and this is what I'm getting on Mintmail I want the mintmail one in the gmail too. Notice the difference between character spacing and the…
Soumyajit
  • 329
  • 1
  • 5
  • 16
1
vote
2 answers

Email template that breaks in outlook

I am new in this sector. I have the html code for an email template that looks good in the web browser and in gmail but it breaks down in outlook. How can I fix it? It looks good in all browsers and mailing platforms without outlook. Where is the…
1
vote
1 answer

how many characters is allowed in phpmailer

I make email function in CodeIgniter and when I set "mailtype = html" I can't send long text but when I set "mailtype = text" I can send email in a long text. I don't know why? I want to send email with "emailtype=html" because I want to use bold,…
1
vote
1 answer

Couldn't prepare mail with inline image using Thymeleaf templateEngine?

I am trying to send a html email with an inline-image attached using spring mvc and Thymeleaf. My code works without attaching the image. I get the html email successfully without image. But When I added the following line to my code I get the below…
sndu
  • 933
  • 4
  • 14
  • 40
1
vote
1 answer

HTML Email Gmail App (Android 6) - How to remove vertical gap between images

I'm having a problem with Gmail App (Android 6.0) HTML email rendering vertical gaps between images. I have no problems at all in other client/screen combinations in Litmus - desktop, mobile, Outlook, IOS, AOL, etc If I remove the td tags between…
Steve
  • 988
  • 1
  • 12
  • 25
1 2 3
99
100