📜 ⬆️ ⬇️

Features processing HTML-letters

Hello, habrayuzer!

Recently it was possible to dig with the distribution of letters in HTML-format. There are many articles written on the topic of valid layout of mailings, however, this is not the point here. It is known that each mailer has its own peculiarities of displaying HTML-letters. I am interested in these features and differences in the display of letters on different mailers.

Three of my mailboxes in the mail.ru, yandex.ru and gmail.com services came under investigation. A script was written that sent the same email to them in html format. With it, I drove a few options and compared the results. Here's what happened:

Body tag


The body of the letter displayed by the postal service begins with the body tag. It is understandable - all the letter is contained in it. However, the body tag itself may contain a style attribute. In each mailer, the body of the letter is represented by a div, but not everyone transfers the contents of the style to this div.

')

Features of attribute transfer style


The style attribute is often analyzed by the mail machine and can be changed before being sent to the user. As it happens on the studied mailers:


Negative values


In all articles on HTML layout, it is repeatedly mentioned that you can forget about negative values ​​(for example, in the margin). The test result is quite expected:

The margin attribute in Mail.ru is only skipped because there are no preprocessing styles.

CSS3 support


CSS 3 is currently in development, and some mailers consider certain attributes to be invalid. So, let's test some CSS3 rules on our three clients:

Mail.ru


Full support for CSS3 and any other browser-dependent attributes due to very loyal filtering of the style tag.

Yandex.ru



Gmail.com




CSS height


The height attribute is not supported by all mailers.


UPD: In the comments, it turned out that javascript: *** and expression: *** tricks are blocked by the mail.ru security system.

Source: https://habr.com/ru/post/146414/


All Articles