All Forces

Design, Music & Mac Geekery

Custom CSS Signatures in Mail

429 Comments
by Melvin Rivera
Updated: Oct 16th, 2009

Mail Signature

The default interface for Mail signatures allows you to do rich text signatures using the fonts and colors palette. You can even drag an image into the compose signature window and it will be included in every email as an attachment. This is fine for most people, but attachments should be just that, an attachment of a file I am sending, not an image in my signature. So here’s an easy guide on how to do CSS signatures referencing images on an outside server and not as an attachment.

This tutorial covers Apple Mail in Mac OS X Tiger v.10.4

STEP 1: Create a new Mail signature

Mail: Create Signature

Launch Mail, located in the Applications folder. From Mail’s top menu, select ‘ Mail > Preferences ‘ and go to the Signature pane. From the Signatures pane, click the plus icon underneath the middle column to create a new Signature. In this example I cleared all my previous signatures for the purpose of clarity but this is not required. Once your signature is created, quit Mail by selecting ‘ Mail > Quit Mail ‘ from the top menu.

Step 2: Create your new signature in a text editor

CSS Signature

Using a text editor application, create your signature using html and css.

TextEdit can be used for this, just make sure save as HTML and not rich text. If you want to use my signature style, just download my html sample file and use it as a starting point.

UPDATE: After publishing this, some of you have discovered that GMail will not display any of the CSS unless it’s inline. So here’s a new revised sample file that has all the CSS inline including the image as an img file instead of a a background css attribute. When using this method, GMail will show a link giving the user the option of showing the embedded images.

If you are starting one from scratch check out A List Apart’s article on CSS in emails. In summary, do not use html, head or body tags, use divs instead. Use embedded CSS not extarnal. Do not use classes that start with a dot, but u can do #div .class instead. The same goes to the a: tag.

Step 3: Create Web Archive from signature

Signature in Safari

Open the signature html file you just created in Safari. You can do this by dragging the actual file icon into the Safari icon in your dock. This should look exactly as you want your signature to look like.

Safari Archive

To save this as a web archive, from Safari’s top menu select ‘ File > Save As… ‘ and save the signature as a Web Archive by selecting ‘Web Archive’ on the Format pulldown menu. Saving to the Desktop makes it easy to find for the next step.

Step 4: Replace old signature with the new one

Signatures location in Finder

From the finder, navigate to ‘ your home folder > Library > Mail > Signatures ‘. Since I only have one signature in Mail, there’s only one ‘.webarchive’ file in this folder. If you have more than one signature, you need to find the one we created on step 1. Open the web archives in Safari to find the one we created in step one. Copy the file name of the archive file and paste the name in the new archive file on the desktop to rename it. Now drag the new signature archive from the desktop into the Signatures folder. It should prompt you asking if you want to replace the file, which you do.

Step 5: Activating the new signature

Rename Signature

Launch Mail and select ‘ Mail > Preferences ‘ from the top menu then go to the Signatures tab. You can rename the signature name here by double clicking it’s name and renaming it. Notice that Mail will not properly render the html in this Signature window but it will render it properly in the compose window.

Assign signatures to accounts

Now drag the signature to the mail accounts you want it available for.

Default Signature

Then select the account from the left column and select the new signature from the ‘Choose Signature’ pulldown menu. This will make it the default signature for that account.

Step 6: Testing our new CSS signature

Compose with new signature

To test our new signature, compose a new email and send it to yourself. You should be able to see the signature in the compose window.

CSS mail signature works!

Click the send and receive button to receive you new email. You should get a new email with your spanking new fancy signature that contains no image attachments. What a concept!

UPDATE: Guide to CSS Signatures on jail broken iPhone by Jiradett


Tagged:

429 Comments

  • Cool, I did have some problems updating it once I had installed it though – had to create a completely new sig! But otherwise worked a treat, thankyou!

  • sam says:

    I use a MAC. I am starting a business and want to appear as proffessional as possible. I’d like to attach my logo to my emails.

    I use Mac Mail.

    When I send an email with my logo in the signature the logo gets striped and is shown as an attachment.

    Do you have any suggestions how to fix this?

    Kind regards,

    Sam from London

  • Reza says:

    Sam … Hmmm … Not sure why you ask the question … this webpage is precisely instructions to just do what you ask.

    Simply follow Melvin’s instructions and you’ll get what you want. Two critical notes:

    1) You need to place your logo on a webserver
    2) Once the logo is on the server, you need to insert the URL to that logo location into the code which Melvin proposes.

    MELVIN … Big Ups mate … a BRILLIANT bt of code … as if you have not heard that enough times :)
    R-

  • Lana says:

    UPDATE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    You CANNOT use TextEdit to write an HTML file. At least not on a macbook running 10.5.6! Or an ibook running 10.4.11!

    After hours of trying and looking for patchy solutions, I finally read Mark Cunningham’s post above and realised it was beacause I using TextEdit!!!!!

    I thought they’d be a few disgruntled comments on here if the actual instructions were wrong!!! So I struggled and struggled, only to find I could do it in seconds when I used Text Wrangler instead!!!!

    Ps. sig works perfectly on the macbook but I’m getting the blue question mark even when composing a message on the ibook. It does work when sent but….

    Melvin, darling…..UPDATE!!!!!!!

  • Submitter says:

    I had a signature for a while now because it is a great way of getting free traffic to your sites or getting new leads. But I have encountered the following problem. Having links or even pictures in the signature can sometimes make your email end up in the spam box on mail sites like yahoo or hotmail. So everybody be careful with this.

    Nonetheless the presented method is wonderful, I never thought of styling my signature until I saw this post. Wonderful, thanks!

  • Steven says:

    My Mail In Google.

  • Sue Kearney says:

    Thanks for sharing this! I love my new signature. Very cool.

  • wiwied says:

    I want to request email signature how about make sure to activity my email, this

    thi is email link : admin.iklan-news-1@blogger.com

  • wiwied says:

    so ……can;t using email my link ?

    ok i will be trying

  • Derrick McBride says:

    Everything was working fine, but when I compose a message it gives me a blue boxe with a question mark in it (where the images should be)……..Please help……

Leave a Reply


Contact Me