Easiest way to send HTML emai

What is the easiest way to send HTML email?

From Panorama, the means is a Python script.

I use Mailbox, available in the Database Exchange to send styled email with embedded images and/or attachments. My copy has been modified to link the included Composer to my Contacts database so that I can send a specified email to one or many selected names.

Given that I do not have any need for graphics but rather merely want to use colored text, bold text, italized text, etc., does that change your suggestion or answer?

No change at all.

Here is an AppleScript approach to sending a rich text email (not HTML as requested). This is for the Apple Mail.app with the preferences set to using rich text as the default for composing messages. The Mail app does not support configuring outgoing messages as rich text using AppleScript so we have to use “System Events” to pull this of using some embedded keystrokes. The rich text message must be on the clipboard for this to work. I also added a couple of returns after the message to keep it from crowding the default signature block. You need to change the Subject and To variables to match your situation.

let testSubject="Testing"
let testTo="yongary@aol.com"
applescript |||
tell application "Mail"
	activate
	set newMsg to make new outgoing message with properties {visible:true, subject:$«testSubject»$}
end tell

tell application "System Events"
	if quit delay ≠ 0 then set quit delay to 0
	
	tell application process "Mail"
		set frontmost to true
		
		tell (first window whose subrole is "AXStandardWindow")
			
			delay 0.05
			
			# Moves focus to the message body.
			tell scroll area 1 to tell UI element 1 to set focused to true
			
			delay 0.05
			
			# Emulate keystrokes for paste using System Events instead of KM for speed and convenience.
			keystroke "v" using command down
			keystroke return
			keystroke return
			
			# Moves focus to To-field:
			tell text field "To:"
				set value to $«testTo»$
				set focused to true
			end tell
		end tell
	end tell
end tell
tell application "Mail"
	send newMsg
end tell
|||
message ScriptResult

This solution was cobbled together from a few different sources found online but does seem to work (at least in 10.13.6).

I was very much excited as I was able to send Rich Text and I only had to grab it from the Clipboard.

And then the reality set it. I wasn’t seeing a method to integrate any Panorama data into my email. It was a blanket send this clipboard item to the emails from your database.

I will need to incorporate Panorama fields or variables into my emails and just don’t see a way to do it with the AppleScript above.

You are very generous to have come up with this answer and while it will work for some, I’m needing more.

Thanks anyway Gary.

Robert, It could be a pain in the butt, but could you select your recipients, then loop through each, incorporate the Pano data, load it on the clipboard, then send one email? Move down one record and repeat.

Interesting thought. Build a clipboard from components. Multiple preset Rich Text pieces along with Panorama data pieces over and over to create a single body ‘clipboard’. Certainly a mess but ya, I guess that could work. The end result will certainly look nice. I guess I was just hoping for something simpler.

Thanks for the prod. I’ll see how messy it will be. Yes, once again, Panorama can do it.

Jim Cook’s solution looks simplest to me.

I have used Jim Cook’s Mailbox solution in a production scenario to send 400+ emails at once, each uniquely customized with information drawn from multiple fields in a Panorama database. It worked flawlessly once I had it configured properly. As Dave mentioned, it easy to create an email with some basic formatting without going whole hog. In my case I had a couple of things in italics and then inserted our logo as part of the signature, just the same as I would in a regular email.