Creating an XHTML signature for Apple’s Mail

06Nov06

After my move from Windows to Mac, there is one little thing that I miss a fair bit… it’s having a nice signature in my emails. This was something very easy to accomplish in Outlook. But proved to be more allusive in Apple’s Mail. So I set out on a mission to uncover how to do it.

Apple mail icon

I found quite a simple example on Macosxhints.com. All very nice, but I needed to know how my signature would look across various email clients and services, such as Hotmail and Yahoo etc.

I’ve created one that works and I’ve also taken some screenshots of how the signature is rendered in five of the most comment email clients/services.

OK lets jump right in

First of all we need to decide on how we want the signature to be built. Initially I thought about using tables to contain the signature, but upon a little bit of research I discovered that the vast majority of email services are compatible with xhtml / css. So that’s that set. Next I needed to decide how I wanted the image to be included. There’s one thing that really annoys me when receiving an email, it’s when they contain useless attachments that come from the email signature itself. Especially annoying when it comes to saving multiple attachments to a folder, I simply don’t want someone’s nasty background line image added to the list of important files.
OK I know, it’s not really important, but I believe that a signature should be as unobtrusive as possible.
I opted to have the image load from my server, with only a simple image reference within the HTML. I chose this because all email applications that I’ve used all cache the images that they download, so it’s not a problem if your email is viewed offline.

With all that in mind, set out and design / build yourself a gorgeous signature in your favourite editor. Make sure you keep all hrefs absolute, relative simply wont do.

Once you’ve designed yourself a tasty signature, the next part to creating it is incredibly easy. Here’s what to do:

  • 1. Make sure you already have a signature set up in Mail. Anything will do, as long as it’s something.
  • 2. Close Mail
  • 3. Load the signature you’ve created into the Safari browser
  • 4. Save it Apple+S as a Web Archive into: ~/Library/Mail/Signatures and replace your desired signature
  • 5. Reload Apple Mail and create a new message. Voila.

~/ = your user name within OS X.

If you have multiple signatures for different accounts and don’t know which .webarchive to replace. Simply open the SignaturesByAccount.plist and find the < array > < string > VALUE < / string > < / array > that relates to the webarchive.

You may find that when you first create a new message the image doesn’t load, and instead displays the Safari question mark ?. Don’t fret, simply send yourself a message so that Mail can cache the image. From then on it’s plain sailing.

Example

This is what I designed for use as my signature: Hopking Design Signature.

Please feel free to take it and customise it as you see fit. One thing I must emphasize in my code is:

< div class=" clear " >< /div > (and the corresponding style)

It’s essential that you use this, or else when you reply to an email with your new signature, the ‘original message’ text will stick to the right side of if like a magnet.

How it renders

Here’s how it renders in the various email clients / services.

Apple Mail:
Apple Mail's - Rendered Signature

Microsoft Outlook:
Microsoft's Outlook - Rendered Signature

Yahoo’s online service:
Yahoo - Rendered Signature

Hotmail’s online service
Hotmail - Rendered Signature

Gmail’s online service
Google's Mail - Rendered Signature

As you can see here the signature renders pretty well across the various services. To my surprise though, Google’s Gmail doesn’t render it at all properly. I looked at the generated source code, it left the DIVs intact, but had striped away the class names?!
I imagined this kind of behaviour from Hotmail. So far, I’ve had no success. If anyone has ideas of a fix, please yell.

That’s it. I hope this helps someone somewhere.

Update: Here’s a great resource for modifying and making the most of Apple’s Mail

Posted at 4pm on 11/6/06 | Filed Under: Web Design, Tutorials |

8 Comments in this entry

[…] Mez Hopking has posted a nice tutorial on making a fancy signature in Mail.app, but it’s a bit old school in parts now. […]

Mez,

Two points.

You can fix the way the signature displays in GMail by embedding your style information directly into the style=”" tag of the divs. A bit of a pain compared to using a class, but not too big a deal for a small signature.

Also you can use my Mail plugin (SignatureProfiler) to insert the webarchive (or html directly) into your signature in Mail.

Nice signature ;-)

scott

Thanks for that Scott. I’ll have a play with your software, looks like an easier alternative to messing with .plist & .webarchive files.

Scott: In case you are still following this — I have been trying to send you an extensive bug report about my problems with the plugin, actually I have sent three mails so far, but they all bounced with errors like this:

—– The following addresses had permanent fatal errors —–

(reason: 550 5.1.2 Host not found: )
Reporting-MTA: DNS; mo-p07-ob.rzone.de
Received-From-MTA: DNS; [85.181.24.236]
Arrival-Date: Wed, 8 Nov 2006 07:10:21 +0100 (MET)

Final-Recipient: RFC822; sigpro.support@littleknownsoftware.com
Action: failed
Status: 5.1.2
Diagnostic-Code: SMTP; 550 5.1.2 Host not found:
Last-Attempt-Date: Wed, 8 Nov 2006 07:10:24 +0100 (MET)
Final-Log-ID: iA848ccN01210E.138cd88

I have given up on the whole thing by now, but if you’re interested in the reasons, let me know…!

MILE,

I haven’t followed for a while, but I’m going to post here anyway in case you still come back. Not sure why you are having this issue. It seems to work for others. You could also try just sigpro@littleknownsoftware.com.

I’ll look at your site to see if I can contct you there as well.

Scott

Hey, I am new to this HTML stuff and absolutely do not understand it. I love your signature and want to put an image to the left like you did and was wondering if you could possibly post up or email me the exact html code you have. Another problem is I want to use an image thats on my computer, and don’t know how to type it out with the HTML code. Any help would be greatly appreciated I’m trying so hard to understand this!

Thanks Mez for the good article. Scott, good call about using inline CSS rather than a stylesheet. Also, the reason it’s not rendering properly in Hotmail is because Hotmail doesn’t support margin (see Campaign Monitor’s article about CSS support in e-mail), which is creating the correct spacing in the other e-mail clients. To get around this, you could use line-height more thoroughly and use BR tags instead of relying on the margin from the P tags.

Hope that makes sense. For more info, I just blogged about creating a HTML signature that displays correctly across all e-mail platforms.

Thank you for this post. I am looking for embedding images in the very signature; I would like to avoid linking them to an external website. Is there a way to do it from mail.app?
Thanks again, best wishes!
German Heller
3Dar VFX Visual Effects Studio
www.3dar.com

Leave a response

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Categories
Recent Entries
Recent Comments
  • German Heller: Thank you for this post. I am looking for embedding images in the very signature; I would like to a...
  • Tyler Tate: Thanks Mez for the good article. Scott, good call about using inline CSS rather than a stylesheet. ...
  • Amelia Clarke: Very pretty design! Keep working. Go on...
  • Laura: I love you ...
  • Alex Green: You are a life-saver, that is Awesome information, if I could link to you in a blog I would!...