thoughton:digitallife banner
about downloads imagery work
-- Apple --

Rich Text (HTML) signatures in Mail.app


I was recently asked to help with setting up an HTML signature in Mail.app. "No problem", I thought. Unfortunately after a few quick attempts I quickly discovered that Mail.app's signature system is atrocious. Typing in plain text signatures (all I've ever done prior to this) is easy. Entering an Rich Text1 signature is not.


The problem is mainly that the editor window is difficult to use. For one thing it relies on the available-to-all-Cocoa-apps Fonts and Colors floating selection windows - which are elegant but seem to be constantly getting in the way just when you least expect it. Also using images in your signature is a pain because the signature window inexplicably doesn't display images you drop into it.

The line spacing in the signature window is also buggy. On several occasions while switching from one signature to another I saw random increases in line spacing as well as inserted line breaks in the middle of sentences. These random increases were cumulative, so after several switches the gap between two lines of text was several centimetres. I encountered similar problems with the "Always match my default message font" checkbox. Selecting and unselecting the checkbox repeatedly again caused the line height to increase to gigantic proportions.

The bug is difficult to reproduce but you can see a hint of it here:
Sig Before

Sig After
After taking the first screenshot I selected and unselected the "Always match ..." checkbox. As you can see in the first image the image is at the end of line 1, but in the second image there are two line breaks between line 1 and the image.

In my search for a solution I found this hint at MacOSXHints. The 6-step method is a bit of a pain, but it works - albeit with a little tweaking:

  1. In step 3 the HTML page you create must use FONT tags to control the text colour and size. Using CSS won't work. Nor will using a BODY TEXT tag.
  2. In step 6 the easiest way to determine which signature file you need to replace is to modify the signature file you wish to replace and quit Mail.app. Now when you open the ~/Library/Mail/Signatures folder you can replace the most recently modified signature file.
  3. And when you eventually send your signed emails, the body of the email must be in Rich Text format, otherwise your finely crafted signature will be displayed as plain text (and also without images).
This method results in HTML signatures in Mail.app which display correctly in Mail.app's signature window without any weird line spacing issues and display correctly in the recipient's email client. It also can't be broken by clicking the "Always match ..." checkbox. All of this is good news, but my main feeling after this is that the whole procedure really should have been much easier.


1 Mail.app's Rich Text format is actually HTML.
Posted on 13 September 2007, to Apple | Internet | Mac OS X

Related entries

Smart mailbox tip - 21 June 2005
Mail.app single keystroke insta-quit - 4 October 2005
New SE P910i P950i leaked - 26 August 2005
Nvu WYSIWYG web editor - 30 June 2005
More WebKit and SVG news - 10 July 2005
Scalable Vector Graphics on a Mac - 1 July 2005
Pondering email - 10 March 2004
Postfix problems - 17 March 2004
Encrypted emails - 17 July 2004

Trackback Pings

TrackBack URL for this entry:
http://thoughton.co.uk/cgi-bin/mt-tb-dlosx.cgi/260

Category icon Sponsors