Adding HTML signature in Apple Mail for Mac
Thanks to LeroyDouglas for answering this
how do I add an html signature to my mac … - Apple Community
by recommending this...
https://matt.coneybeare.me/how-to-make-an-html-signature-in-apple-mail-for-macos-catalina-10-dot-15/
In macOS Sequoia 15.4.1, Coneybeare's tutorial for macOS Catalina still seems to work.
But if you want to embed a graphic, like a logo, that method doesn't work unless you put the graphic somewhere on the internet and have your html code load it (when the recipient opens the email).
That’s not so good because nowadays for security and privacy, many email services and client programs won't load an email’s externally referenced images automatically or at all.
Some email services let you click "load images" etc but one I tried didn’t show the logo or offer a load or download option.
I found another way that uses much of Coneybeare's instructions.
Drop a graphic directly into Apple Mail's settings / signature / new signature window. (I didn't type any place holder text.)
Quit Apple Mail and use Coneybeare's instructions to find the signature file.
Open the file. (I used BBEdit.)
You’ll see the html SPAN tag referencing an OBJECT.
Below the SPAN tag, you'll see a giant block of gibberish text. It's base64 encoding of the graphic. That’s the graphic turned into base64 gibberish text so it can be embedded into the signature without having to store and reference the image somewhere else.
Above that block of gibberish there’s a section that starts "--Apple-Mail=...." then 4 lines, each starting "Content...."
The last line in my case had "Content-Id: <B9833399-4663-4B1F-BEEF-BDA150608C05>" which the SPAN tag references.
So instead of using " <body> your html code </body> " you can just use SPAN tags to insert your html code into the existing signature file that contains your graphic (and you can mess with the graphic's SPAN tag).
Here's an example of an Apple Mail-created SPAN tag for a graphic in a signature:
<SPAN class="Apple-string-attachment"><OBJECT height=98 width=139 type=application/x-apple-msg-attachment data="cid:B9833399-4663-4B1F-BEEF-BDA150608C05"></OBJECT></SPAN>
The cid:..8C05 is exactly the same as the gibberish code block's Content-Id above. The SPAN tag references the graphic that way.
You can insert all your html code as SPAN tags.
Also, though I haven't tested it, it might work to first use an app or Terminal to convert your graphic to base64 then insert the base64 gibberish with relevant lines into html body or SPAN tag code.
NOTE Coneybeare’s instructions to Lock the modified signature file.
SUMMARY of METHODS
• Coneybeare's method: almost gut an Apple Mail-generated signature file and use html <body> your html stuff </body> (but without any graphic)
• Coneybeare’s method but include a base64 graphic in your html code
• Drop a graphic in a signature in Apple Mail so it encodes the graphic as base64, then edit that signature file just with SPAN tags.
POST MORTEM
The signature with a logo looked perfect in a new message using SPAN tags (and in Apple Mail’s Sent folder) BUT its formatting looked awful in recipients' email services (e.g., web view of gmail).
Formatting issues were almost certainly caused by my very rusty html positioning skills that I used within SPAN tags. I had remembered enough skill to make it look good on the way out but not enough skill to make it look good for recipients' different email systems. I ran out of steam and stopped trying to nail it down.
Btw, always test your html signature by sending it to another email service (or 2 or 3 or 4) and viewing it there so you don't embarrass yourself.
I also tested making the same signature without any html coding in a Microsoft-hosted corporate email account. The signature looked perfect in the web view at outook.com and in the Outlook app on macOS, iOS and iPadOS. It also looked perfect in recipient systems (e.g., gmail web view and iCloud in macOS, iPad and iPhone Apple Mail). The only glitch was during creation: after copy/pasting the signature text w/logo into the signature window, I had to go back an paste just the logo into the space where the logo disappeared.
Apple, please emulate MS's signature feature.
ANOTHER IMPERFECT WORKAROUND
If you insist on a specially formatted signature with graphics in Apple Mail, you can paste one big graphic of your signature into Apple Mail's signature window.
The graphic always looks perfect but its visual elements in the graphic aren’t clickable, e.g., recipients can’t highlight text in it or click a url, phone number or email address in it.
You can make it by taking a screenshot of your perfectly formatted signature in a program like Pages, Affinity Designer, etc. then drop the screenshot by itself in Apple Mail's signature window or try adding a little text above or below the inserted graphic.
After hours of testing, I concluded it’s best to use a simple signature that doesn’t require any extra html work. Ugh.
MacBook Pro (M4)