When sending HTML emails in any email marketing software, we understand that it is of the utmost importance that your layout and CSS styles are compatible across all of the major email clients. If you have been experiencing problems with your CSS styles in your HTML emails not showing up properly when your emails are sent, here are two things to look out for:
Internal Stylesheets vs. Inline Styles
The most important thing to remember is that, when possible, you should always use inline CSS tags, rather than using a stylesheet included in the header of your HTML code, or an external stylesheet. Normally, you might send an email with code that looks like this:
However, many email clients will ignore some of these styles, or display them improperly. If you find that this approach is causing problems in certain mail clients, you should instead try sending an email using inline styles. Inline styles are CSS styles that are added directly to each HTML tag, like this:
<html> <body> <font style="color: #0000FF; font-weight: bold;">Here is some text</font> </body> </html>
This approach will usually resolve any issues with CSS not appearing in your HTML emails.
Extra dots appearing in your stylesheets?
If you are using an internal stylesheet rather than inline styles, and you are noticing that your styles are being ignored altogether, try taking a look at the source code of your email after it is sent. (You can also choose the "Message Preview" option, and click on "Source" to see the source code before you send it, on the last step of the Campaign Create process.) Take a look at your style sheet -- do you see extra periods appearing in front of each of your CSS classes? It may look like this, for example:
Note that there are two periods in front of each class, instead of only one. This is actually a problem that sometimes occurs with the MTA (mail transfer agent) on the mail server level. Though we still recommend using inline styles rather than internal stylesheets, which would negate this problem entirely, we do offer a fix for this issue. To turn on the "dot fix" fix for your default mail connection, run the following query on your MySQL database:
UPDATE em_mailer SET dotfix = 1 WHERE id = 1;
As mentioned before, this issue is specific to your mail server. If you are rotating between different mail connections, make sure that id is equal to the id number for whichever mail connection this problem is occurring with. Turning the dot fix on for connections in which this problem is not occuring could cause other errors, so if you do have multiple mail connections, you would want to make sure you are turning on the fix only for the problematic connection.
If you are unsure how to do this, please do not hesitate to contact our technical support department for further assistance!
* * * This fix only works for version 5.0+. If you are running version 4.X, please contact our support department for a different fix!