Coding in email design
Creating the design of an email is not the same as creating the design of a website. First of all, it is advisable to avoid complex designs, since the greater the complexity, the more likely it is that the email will not look good in all types of mail (Outlook, Thunderbird, Hotmail, Gmail, Yahoo, etc.). Simplicity not only means elegance, but also the certainty that the recipients of our email will be genuine recipients of our advertising message. Trial and error will also help us determine which code is the most optimal for each email provider.
In any case, it is important to follow the following recommendations:
1- Use tables for content layout, not divs
The only way for our email design to have a structure is by using Tables. Divs are really useful, but only for website design. If we use them in email, we won’t be able to align our content.
2- CSS is always inline
To format the content of our email, it must be defined within the tables or (preferably in the TD tags), but never in separate stylesheets, nor in the head of our HTML. We recommend using the tags within the Only for responsive design using media queries.
3- Balance of images and text
If we abuse the images, there is a greater chance that our email will end up in the spam folder. For that reason, the best thing to do is to achieve a balance between these and the text.
4- Hosting the images on a server
Most webmail clients do not support embedded images or very heavy ones. The key is host the images on a server, From our design, by means of a URL.
5- Take care of the weight of the emails
It is especially important to take care of the weight of the images and optimize them for the web if we want good reception of our emails. By incorporating an image with a dpi of 300 in our design, the only thing we will achieve is that the loading time of the same will be too long. In fact, we can display the same image at 72 dpi making the user's waiting time much shorter.
6- Defining the ALT’s
There are many recipients who have image navigation disabled. The Definition of the ALT’s It will make it possible for those who have image navigation turned off to know, for example, where there is an action call, where there is an image of the product, etc.
7- Remembering that an email is not a website
We cannot use JavaScript, PHP or Flash, as these would not be loaded or cause the email to end up in the spam folder directly.
8- Avoid using horizontally cut images
To prevent extra spaces from being created between images, the following code must be added to each of them: <td> in which there are images: style=”border:none; font-size:0; line-height:0; letter-spacing:0; padding:0px; margin:0px;”.
9- Avoid using rowpans
It is also important to avoid using rowspans when encoding the email. Some email providers such as Lotus and Hotmail will not display them correctly, so the best alternative is to use colspans or tables.