Knowledge Base

How to remove spacing between e-mail body and signature

Problem:

While composing a signature you may encounter a problem where the spacing between e-mail body and signature is too wide. This may be caused by incorrect signature design or unnecessary tags used in the HTML code of the signature.

Solution:

Here are the most common reasons to such a behavior:

Please keep in mind, that editor used in CodeTwo Exchange Rules Pro 2.x, CodeTwo Exchange Rules 2007 4.x, 2010 3.x and 2013 2.x accepts only lowercase tags (e.g. span), while editor used in CodeTwo Email Signatures and earlier versions of CodeTwo Exchange Rules family software, both standard and PRO versions, accepts only UPPERCASE (e.g. SPAN) tags.

  1. There may be an empty paragraph tag (<P>)on top of your signature template. It does not add any content to the signature other than an empty space. An empty paragraph usually looks like this: <P>&nbsp;</P>.
  2. When adding an image or a table on top of your signature you may add a too large top margin for the added object. To make sure that does not happen you can edit the MARGIN-TOP attribute to be "0". An example of such code would be: <IMG style="MARGIN-TOP: 0" title="example" alt="[image]" src="http://imageserver.com/image.png">
  3. Similarly to MARGIN you may also need to add  PADDING. The padding clears an area around the content (inside the border) of an element. Therefore if you create an object with assigned PADDING you may experience too wide top spacing between e-mail body and signature. In such a case it is best to assign PADDING-TOP in the value 0. For example: <TABLE style="PADDING-TOP: 0; PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt">
  4. It is also possible to set the line height for each line created in your signature, this is done by using the CSS style LINE-HEIGHT. However, abusing this style may cause unnecessary spacing. 
  5. Consider the difference in line breaking. Instead of hitting Enter key (generating new paragraph) or appending additional table cell, you may simply use Shift+Enter shortcut that only breaks the current line. 
  6. The paragraphs generated in HTML code may be displayed differently depending on the application used. For example in OWA application all paragraphs are shown without any margins, when in desktop Outlook the spacing is pretty visible. To avoid such problem you may add MARGIN and PADDING attributes (like in points 2 and 3).
  7. You might want to implement a scenario where your signature is divided into two separate rules. For instance: one of the rules contains a signature and the second one contains only a disclaimer. Once the both templates are inserted into your message you notice that there is a gap between them. This can be resolved by adding the style MARGIN: 0 for any element after the <BODY> tag in the second template. It would look like this:
    <BODY>
    <P style="MARGIN: 0">...</P>
  8. When creating a template in some third party tool it may add some tags that are not supported by our software nor even valid according to W3C standards. Importing the code created in such a tool to the Template Editor of any of CodeTwo products may cause the template to be displayed incorrectly. One of the problems can also be some additional spacing. For that reason we always recommend designing signatures directly in our built-in Template Editor.
  9. If you are experiencing unnecessary spacing when sending e-mails from iPhones or iPads please check if your iOS signature does not have any spacing in it. To do so please access the device Settings, navigate to Mail, Contacts, Calendars:
     

    455-1
    Fig. 1. iPhone settings.

    Next, locate the Signature option:

    455-2
    Fig. 2. Signature option location.

    And check the signature for any unnecessary spacing:

    455-3
    Fig. 3. iPhone signature.

See also: