Having a signature in every outgoing mail is a plus—you can advertise yourself or show professionalism. MacOS Mail's built-in signature tool is great; however, it's not easy to customize, especially adding a hyperlink on a picture (for me the hyperlink breaks every time). Since today's e-mail can be drafted in html format, why not use an html code to represent your personalized signature?
You don't need to know how to code in html beforehand; there are several online WYSIWYG html editors, such as this online html editor
Paste your signature to Mac Mail
Once you're satisfied on your signature html file, now open Mail app and then go to the setting. Navigate to the signature tab and create a signature only if you don't have one (the purpose is to create a signature folder).

Note: do not include <!DOCTYPE html> in your signature html file; otherwise Mac Mail will reset your signature to default signature.

Then, open the Terminal.app
If you turned on iCloud
Type (or copy and paste) on the console but do not press return/enter key yet!
nano ~/Library/Mobile\ Documents/com~apple~mail/Data/MailData/Signatures/
nano ~/Library/Mobile\ Documents/com~apple~mail/Data/V4/Signatures/ (tested on macOS 10.14 Mojave and macOS 10.15 Catalina)
If you do not to use iCloud
Type (or copy and paste) on the console but do not press return/enter key yet!
nano ~/Library/Mail/V2/MailData/Signatures/
nano ~/Library/Mail/V3/MailData/Signatures/
nano ~/Library/Mail/V7/MailData/Signatures/ (tested on macOS 10.15 Catalina)​​​​​​​
Note: Mac Mail's signature can only stay in 1 location.
Once copied and pasted the command, press tab key and you will see one or few .mailsignature files with random file name:
If you don't see any output (usually you will hear a beep from speaker), try another directory (sometimes you can change V4 to V3, V2, etc.)
Note: don't close the Terminal app yet!
Now create another signature in the Mail app, and then quit the Mail app. Go back to Terminal app and press tab key again. You will see a new .mailsignature file
Just type first few letter and then press tab key; the terminal will automatically complete the file name.
Then press enter/return key; the GNU/Nano program will open in terminal
If the first line of does not contain "7bit", change the first line to Content-Transfer-Encoding: 7bit
If your signature contains non-ASCII characters (such as non-english letters), change charset=us-ascii to charset=utf-8

Navigate the cursor to the line under Mime-Version: (in this screenshot the line is <body dir="auto" style="caret-color: rgb(0, 0, 0);...)
Use Control+K to delete the entire line.
Now, copy your entire html content and paste them here
Press Control+X to exit, type y to save the change.
Finally, you can open your Mail app again and you will see your new and beautifully-crafted html signature.
Extra Notes:
CSS is not supported, use style tag to specify content's style.
If your html signature contains images, the preview under signature tab (in Mail's setting) will see white boxes with a black boarder. This is normal. Draft and send a test email using this signature to verify whether it's working.

My Other Projects

Back to Top