Installing HTML email signatures in Apple Mail Print

  • 38

If you have comissioned a custom email signature from us, or created your own, here is how to install it in Apple Mail:

Step 1: Load remote content in messages

If your signature contains images then we need to configure Apple Mail to load remote content otherwise your images may not be visible.

In Apple Mail, go to Preferences > Viewing

Tick Load remote content in images

Step 2: Add a New Placeholder Signature

In Apple Mail, go to Preferences > Signatures and create a signature with any random content, write something you will easily recognise here, we will use this later to make sure we are editing the right signature file.

Name it something meaningful in the central column.

Associate the placeholder signature with one of your email accounts by dragging its name from the second column on to an email account in the first column.

Untick Always match my default message font. This is very important.

Close the Preferences window to save it, then Quit Apple Mail.

QUIT APPLE MAIL!!

Step 3: Find the new signature file

Apple Mail stores it's signatures in hidden folders, you cannot browse to these folders in the finder.

So instead we are going to use the Terminal app.

Open Terminal, it can be found in your Applications > Utilities folder

We are now going to type a command to list all the signature files in the Apple Mail signatures folder, the location of this folder varies depending on your iCloud settings. If you are not sure, try each one in turn until you find the signatures.

Type (or copy and paste) the command that applies to you from below and then press enter:

OSX Sierra (10.12.x):

Using iCloud:

ls -lt ~/Library/Mobile\ Documents/com~apple~mail/Data/V4/Signatures/

Not using iCloud:

ls -lt ~/Library/Mail/V4/MailData/Signatures/

When you find the correct command you should see a list of information similar to this:

-rw-r--r--@ 1 chris staff 13K 11 Aug 2014 ubiquitous_56FFB484-3C7C-49DC-BB5B-9D96C814189C.mailsignature
-rw-r--r--@ 1 chris staff 19K 29 May 2014 ubiquitous_FCCD0DD1-6034-46C3-990B-D44AF1459974.mailsignature

It lists the files found with informatuon about the files on the left and the file name on the right. The most recent file will be listed first.

The signature file names are random numbers and letters ending with ".mailsignature".

We need to locate the file for the placeholder signature we created in step one. It will be the newest signature file there. The one created just a few minutes ago when you added the placeholder signature. If you don't see a signature file with a date and time that looks correct then you have not found the right folder yet and will need to look in the other folders until you find it.

So in the above example it would be the file named:
"ubiquitous_56FFB484-3C7C-49DC-BB5B-9D96C814189C.mailsignature"

Make sure you make a note of the name of the file AND the correct command type that you used to find it (Using iCloud Drive, OR Not using iCloud Drive, but still using iCloud, OR Not using iCloud). Remembering this information will save some headaches later.

Step 4: Open the New Signature file

Once you have found the correct file use the following command to open the file. (Sadly you cannot simply click on the file in Terminal)

Once again you will need to select the correct command based on the location of your file. Replace FILE_NAME with the correct name of your signature file that you located in step two. Once you have typed the command, press enter.

OSX Sierra (10.12.x):

Using iCloud:

open -a TextEdit ~/Library/Mobile\ Documents/com~apple~mail/Data/V4/Signatures/FILE_NAME

Not using iCloud:

open -a TextEdit ~/Library/Mail/V4/MailData/Signatures/FILE_NAME

You should now have the signature file open in TextEdit. You should see the random content that you entered in the first step, if you don't see this then you have opened the wrong file and will need to go back a step until you find the right one.

Step 5: Replace Placeholder Text With Your HTML Code

At the top of the file you will see some metadata followed by a blank line, make sure you leave this and the blank line untouched. The meta data will look something like this:

Message-Id: 
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
Content-Type: multipart/related;
	type="text/html";
	boundary="Apple-Mail=_FC180C67-3683-4945-A501-42C67A688133"

Erase all content after the metadata, preserving the blank line, and paste your HTML signature code.

If we have created a signature for you, you will have received an HTML file with a .html extension containing the HTML code for your signature. To open this file first open TextEdit, then hit File > Open then click the Options button and tick "Ignore rich text commands". Then browse for the signature file and open it.
You should see the raw HTML code for your signature. Copy all of this code and then switch to the placeholder signature file you opened before. Erase all content after the metadata, preserving the blank line, and paste your copied HTML signature code.

Hit File > Save.

Step 6: Lock the signature file
Even though you save this file, Apple Mail may use the original version and overwrite your new signature unless you lock the file.

Make sure you have saved the file and closed TextEdit

Return to Terminal and type the following command to lock the file, once again you will need to choose the right command to use. Replace FILE_NAME with the correct name of your signature file that you located in step two. Once you have typed the command, press enter.

OSX Sierra (10.12.x):

Using iCloud:

sudo chflags uchg ~/Library/Mobile\ Documents/com~apple~mail/Data/V4/Signatures/FILE_NAME

Not using iCloud:

sudo chflags uchg ~/Library/Mail/V4/MailData/Signatures/FILE_NAME

When you type this command you will be prompted to type your password to make the change. Type your password and press enter.

That's it!

Open Mail and send yourself an email to test the signature.

Note that if you ever need to edit the file again, then you will need to unlock the file. To unlock the file use the following command:

OSX Sierra (10.12.x):

Using iCloud:

sudo chflags nouchg ~/Library/Mobile\ Documents/com~apple~mail/Data/V4/Signatures/FILE_NAME

Not using iCloud:

sudo chflags nouchg ~/Library/Mail/V4/MailData/Signatures/FILE_NAME

Was this answer helpful?

« Back