Title: HTML email format issue
Last modified: August 21, 2016

---

# HTML email format issue

 *  Resolved [newuser2](https://wordpress.org/support/users/newuser2/)
 * (@newuser2)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/html-email-format-issue/)
 * I’ve just bought the premium version, which so far is great. However i need some
   help…
 * I’m actually a web ‘designer ‘(not developer) so know basic HTML, but the HTML
   emails when previewed in my inbox show with massive line breaks.
 * When i view the raw message code (in my Mac) it shows there has been tonnes of
   line and paragraph breaks added to the code…
 * How come? Can i solve this?
 * [http://wordpress.org/extend/plugins/subscribe2/](http://wordpress.org/extend/plugins/subscribe2/)

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/html-email-format-issue/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/html-email-format-issue/page/2/?output_format=md)

 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/html-email-format-issue/#post-3666734)
 * [@newuser2](https://wordpress.org/support/users/newuser2/),
 * What does your email template look like? Also bear in mind that the HTML email
   will simply include the HTML layout and formatting applied in your post content(
   both directly and via any plugin filters) so check the source of the post in 
   the HTML view (instead of the visual view and then you can see if the formatting
   is actually coming from the post content.
 *  Thread Starter [newuser2](https://wordpress.org/support/users/newuser2/)
 * (@newuser2)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/html-email-format-issue/#post-3666739)
 * So the style.css of the blog is affecting the emails?
 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/html-email-format-issue/#post-3666741)
 * [@newuser2](https://wordpress.org/support/users/newuser2/),
 * Quite possibly, go to Subscribe2->Settings and in the Email Settings tab check
   if you are including the theme CSS into your HTML emails in the settings that
   says:
    ‘Include theme CSS stylesheet in HTML notifications’
 *  Thread Starter [newuser2](https://wordpress.org/support/users/newuser2/)
 * (@newuser2)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/html-email-format-issue/#post-3666772)
 * Seems the Subscribe / Unsubscribe confirmation email is ok, but the New Post 
   email is gappy!
 * See this [example email to see](http://i1225.photobucket.com/albums/ee398/76uk/email-example.jpg).
 * This one is ok… [see here](http://i1225.photobucket.com/albums/ee398/76uk/ok-email.jpg).
 *  Thread Starter [newuser2](https://wordpress.org/support/users/newuser2/)
 * (@newuser2)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/html-email-format-issue/#post-3666773)
 * BTW i disabled the ‘Include theme CSS stylesheet in HTML notifications’ option
 *  Thread Starter [newuser2](https://wordpress.org/support/users/newuser2/)
 * (@newuser2)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/html-email-format-issue/#post-3666777)
 * I’ve previewed the email in Dreamweaver and various online tools and it appears
   fine. I don’t understand why its formatting different to the other email…
 *  Thread Starter [newuser2](https://wordpress.org/support/users/newuser2/)
 * (@newuser2)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/html-email-format-issue/#post-3666779)
 * On sending the email the plugin is adding a bunch of para and line breaks to 
   the end of every line, even the head and body tags…
 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/html-email-format-issue/#post-3666824)
 * [@newuser2](https://wordpress.org/support/users/newuser2/),
 * Before I can offer any guidance on this I need to see what you have as your email
   template, please can you copy and paste it onto here.
 *  Thread Starter [newuser2](https://wordpress.org/support/users/newuser2/)
 * (@newuser2)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/html-email-format-issue/#post-3666843)
 * Here you go:
 *     ```
       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
       <html xmlns="http://www.w3.org/1999/xhtml">
       <head>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
       <link rel="stylesheet" type="text/css" href="http://joinalpha.com/blog/css.css">
       </head>
       <body>
       <div style="width: 550px; margin-left: auto; margin-right: auto; margin-top: 10px">
       <div style="font-family: helvetica; color: #898989; background-color: #393; padding: 5px 0px 5px 20px" >
       <p><img name="" src="http://i1225.photobucket.com/albums/ee398/76uk/mailhacker-white.png" alt="" />
       </p>
       </div>
       <div style="font-family: helvetica; color: #898989; background-color: #ffffff"> </div>
       <div style="font-family: helvetica; color: #898989; background-color: #ffffff"><font size="3">Here's the latest MailHacker blog post. Let us know what you think.. </font></div>
       <div style="font-family: helvetica; color: #898989; background-color: #ffffff"> </div>
       <div style="font-family: helvetica; color: #898989; background-color: #e6f2f5; font-size: 120%; border-width: 1px; border-color: #d0e6ec; border-style: solid; padding: 10px 5px 0px 10px">MailNinja has posted a new item:
       <p>'{TITLE}'</p>
       <p>{POST} Click to continue reading... {PERMALINK}</p>
       </div>
       <p style="font-family: helvetica; color: #898989; background-color: #ffffff; margin-bottom: 2px"><span style="color: #666666">The MailNinja team</span></p>
       <div style="font-family: helvetica; color: #898989; background-color: #ffffff; margin-bottom: 2px"><span style="color: #666666; font-size: 95%"> </span></div>
       <div style="color: #898989; margin-bottom: 2px">
       <div align="center" style="color: #999999; font-size: 14px">
       <div align="center"><font color="#666666"><span style="background-color: #FFFF00"><font face="Verdana">Grow your business with MailNinja. <a title="" href="#">Click here to learn more</a></font></span></font></div>
       </div>
       <font color="#666666"><span style="color: #898989"><div style="font-family: helvetica; background-color: #ffffff"> </div></span></font></div>
       <div style="font-family: helvetica; color: #898989; background-color: #ffffff; margin-bottom: 2px"></div>
       <div style="font-family: helvetica; background-color: #ffffff; color: #999999; font-size: 95%" align="center">
       Need help? Have suggestions? Want to vent? We want to hear from you </div>
       <div style="font-family: helvetica; background-color: #ffffff; color: #999999; font-size: 95%" align="center"> <a title="" href="mailto:hackers@mailninja.co.uk">Send us an email any time!</a></div>
       <div style="font-family: helvetica; background-color: #ffffff; color: #999999; font-size: 95%"> </div>
       <div style="font-family: helvetica; background-color: #ffffff; color: #999999; font-size: 95%"></div></div>
       </body>
       </html>
       ```
   
 * **_[Please use the code buttons when posting code here]_**
 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/html-email-format-issue/#post-3666845)
 * [@newuser2](https://wordpress.org/support/users/newuser2/),
 * That’s way too much HTML you have in the template, the plugin creates the HTML
   for everything outside the body tags so you only need to create the template 
   for what is inside the body tags.
 * If you want to add a different stylesheet that’s fine, you need to use a little
   code like this in a custom plugin:
 *     ```
       function my_s2html_filter($email) {
       if ( empty($email) ) { return; }
   
       list($first, $second) = explode('<head>', $email, 2);
       $email = $first . '<head><link rel=StyleSheet href="http:www.myurl.com/style.css" type="text/css" media=screen>' . $second;
   
       return $email;
       }
   
       add_filter('s2_html_email', 'my_s2html_filter');
       ```
   
 * So, all of the additional line breaks are coming from the template where you 
   have put line breaks in the HTML tags.
 *  Thread Starter [newuser2](https://wordpress.org/support/users/newuser2/)
 * (@newuser2)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/html-email-format-issue/#post-3666847)
 * I recognise the following as HTML, but the rest isn’t is it?
 *     ```
       <head>
       <link rel=StyleSheet href="http:www.myurl.com/style.css" type="text/css" media=screen>
       ```
   
 *  Thread Starter [newuser2](https://wordpress.org/support/users/newuser2/)
 * (@newuser2)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/html-email-format-issue/#post-3666848)
 * Are tables allowed? The following has no line breaks but still shows with gaps:
 *     ```
       <div style="width: 550px; margin-left: auto; margin-right: auto; margin-top: 10px">
       <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
       <td height="20" align="right" valign="middle" bgcolor="#393"><table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
       <td height="13" align="left" valign="middle"></td>
       </tr>
       </table>
       <table width="97%" border="0" cellspacing="0" cellpadding="0">
       <tr>
       <td height="13" align="left" valign="middle"><img name="" src="http://i1225.photobucket.com/albums/ee398/76uk/mailhacker-white.png" alt="" /></td>
       </tr>
       </table>
       <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
       <td height="12" align="left" valign="middle"></td>
       </tr>
       </table></td>
       </tr>
       </table>
       <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
       <td height="20" align="left" valign="middle"></td>
       </tr>
       </table>
       <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
       <td align="left">
       <h1>{TITLE}</h1>
       </td>
       </tr>
       </table>
       <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
       <td height="20" align="left" valign="middle"></td>
       </tr>
       </table>
       <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
       <td height="20" align="left" valign="middle">
       <h5>{POST}</h5>
       <p>&nbsp;</p>
       <h5>Click to continue reading... {PERMALINK}</h5>
       </td>
       </tr>
       </table>
       <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
       <td height="30" align="left" valign="middle"></td>
       </tr>
       </table>
       <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
       <td align="left">
       <h2>97% of people think we rock.</h2>
       </td>
       <td align="right">
       <a href="#" class="four">Find out why&nbsp;&rarr;</a>
       </td>
       </tr>
       </table>
       <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
       <td height="30" align="left" valign="middle"></td>
       </tr>
       </table>
       <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
       <td align="left">
       <h7>Need help? Have suggestions? Want to vent? We want to hear from you, <a href="mailto:hackers@mailninja.co.uk" class="four">drop us an email</a></h7>.</td>
       </tr>
       </table>
       </div>
       ```
   
 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/html-email-format-issue/#post-3666851)
 * [@newuser2](https://wordpress.org/support/users/newuser2/),
 * I’m not sure I understand what you are asking about, my code or yours.
 * My code is PHP as that is what WordPress and Subscribe2 are written in. You need
   to use PHP to create a little plugin to Subscribe2 to allow you to use your own
   custom CSS in the emails.
 *  Thread Starter [newuser2](https://wordpress.org/support/users/newuser2/)
 * (@newuser2)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/html-email-format-issue/#post-3666852)
 * What… can’t i simply have a tag in the header of the email template that calls
   to a CSS file?
 * Why do i have to create a new plugin to style your plugin?
 * I’ve paid for your plugin on the premise i can style the outgoing emails (or 
   i would have used the free version) and now i have to create another plugin to
   style it???
 * _This isn’t good is it?_
 * To remedy this could you give me a readymade plugin i can use?
 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [13 years, 3 months ago](https://wordpress.org/support/topic/html-email-format-issue/#post-3666854)
 * If you paid for that plugin it wasn’t for the one supported here. We do not support
   commercial software here and you need to take conversations regarding the paid
   versions somewhere else.
 * [http://semperplugins.com/support/](http://semperplugins.com/support/)

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/html-email-format-issue/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/html-email-format-issue/page/2/?output_format=md)

The topic ‘HTML email format issue’ is closed to new replies.

 * ![](https://ps.w.org/subscribe2/assets/icon-256x256.png?rev=2318630)
 * [Subscribe2 - Form, Email Subscribers & Newsletters](https://wordpress.org/plugins/subscribe2/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/subscribe2/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/subscribe2/)
 * [Active Topics](https://wordpress.org/support/plugin/subscribe2/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/subscribe2/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/subscribe2/reviews/)

## Tags

 * [subscribe2 html](https://wordpress.org/support/topic-tag/subscribe2-html/)

 * 22 replies
 * 4 participants
 * Last reply from: [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/html-email-format-issue/page/2/#post-3666944)
 * Status: resolved