Menu Fermer

HTML SIGNATURE IN APPLE MAIL

In this article, you'll learn the process of creating an HTML signature in Apple Mail app.

1) First, on your mac, open Mail app.

  1. Then go to Preference > Signatures.
  2. Choose the email account you want to customise the signature in the left
  3. Click on + icon below to create a new signature. 

 

mail html sign 1
  1. You can name your signature if you wish on the center column. In the next column, you can replace the signature contents.
    1. But this one should be recognizable to you as we'll use it to help identify the correct signature system file.
  2. Then, ensure the "Always match my default font" checkbox is on off. 
  3. Once done, close the Preference window to save it, and Quit Apple Mail. Be sure that the app does not work in background.

2) Now, we are going to open the HTML signature file.
For that we will use TextEdit to open the code file, so we need to ensure that it's setup properly to display the raw HTML code.

  1. Open TextEdit ( you can find it in Launchpad).
  2. Start a New document, and go to Preferences > Open and Save.
  3. Ensure that the checkmark next to "Display HTML files as HTML code instead of formatted" text is ticked.
  4. Close the Preferences panel, and close the new document.
mail html sign 2

3) Now, we need to locate the folder containing the signature.
But Apple hides these files from people as they usually contain info that is not usually editable. Keep in mind that, the files can be in 2 different places depending on whether you are using iCloud Drive or not.

  1. Check to see if you are using iCloud Drive by going to System Preferences > Apple ID, then check if the iCloud Drive checkbox is ticked or not.
  2. Click the Options button next to iCloud Drive to double-check if the checkbox next to Mail is ticked.
  3. If both of these checkmarks are ticked, then you are using iCloud Drive.
mail html sign 3
mail html sign 4

4) If you are using iCloud Drive, you have to use the Terminal to found the signature file.

  • Open the Terminal, you can find it in Launchpad  
  • Copy/Past the following line into the terminal and press enter 
    • cd ~/Library/Mobile\Documents/com~apple~mail/Data/V4/Signatures/ && ls -l 
  • This line tells Terminal to list all the files in this directory and display some of the files info.
mail html sign 13

Look at the right side column — the file names — and notice the ones that end with .mailsignature.
Those are the files we are interested in working with.
If you get an error, make sure you pasted the line in exactly like shown on the previous step. You may not be using iCloud Drive if the problem persist, then move to step 5.

If you have only one .mailsignature file, then this is most likely the signature file you created in the earlier steps. You may have to find the one you created earlier If you have more than one .mailsignature file in there. It will most likely be the top one, but you can check by opening them all and seeing their contents.

  • Copy/Paste the following command on the terminal then press enter
    • open -a "TextEdit" *.mailsignature
  • This line tells Terminal to open all files in that directory that have a filename that ends with .mailsignature, and to open them using the TextEdit application.
  • Once you have the file(s) open in TextEdit, move on to step 9.

5) If you're not using iCloud Drive, you can use the finder to open the signature file we need.

In finder,

  • Select the menu bar item Go > Got to Folder
mail html sign 5

6) A panel will popup that allow you to input the direct path to the signature folder. 

Copy/Paste the following line into the box : 

  • ~/Library/Mail/V5/MailData/Signatures/
mail html sign 6

7) Then click Go
A finder window should appear with several files. Notice the ones that end with .mailsignature . These are the files we interested in working with, because the signature you created earlier is among them.

mail html sign 7

8) Locate the most recently modified .mailsignature file. 
If you have more than one signature file in there, you can open each of them to help you find the right file. It should contain the placeholder text you enter when you created the signature (in this step).

To open the file and see its content, do the following : 

  • Right-click on the .mailsignature file in finder
  • Select Open With, and choose TextEdit.
    • If TextEdit is not an option,
      • Choose Other > Applications > TextEdit.

9) Now that you have the signatures file open in TextEdit, we need to ensure that it is the right one. Scan each of them and see if one of them have the signature you entered earlier (here) in the Mail app Preference panel.

mail html sign 8

Here, we know we have the correct file because we can clearly see our signature:Pokemon catch them all.

10) If you cannot find the signature, you may still be in “edit” mode on the signature. Try closing the Mail > Preferences Window, quitting Apple Mail and repeating the previous steps.
If you still cannot find the placeholder, you may need to double check that you are/aren’t using iCloud Drive, as detailed in this step.

11) Feel free to resize the window to make text editing a bit easier. You will see a few metadata lines on the top of the file and some HTML code below it. Select all that code from the line starting with body, all the way to the end of the file.

mail html sign 9

Keep the top metadata lines, and delete the entire block of HTML code.

12) Still keeping the top metadata lines, paste in your own custom HTML code from earlier.

mail html sign 10

Save and close the file, then Quit TextEdit.

13) Open Apple Mail and go back to Preferences > Signatures. If you have images in your signature, they will not show here in the preview, but they will show in the real signature as long as your coded image source location is valid.

mail html sign 11

14) To test that it is working correctly, simply compose a new email using the account you associated this new signature with, and set the signature (right side of screen) to be the one with the name you created earlier.
If the images show, and everything looks as it should, you have succeeded!

mail html sign 12