Email: Mailto Bulk Emailer Composer

Hey all,

I’m trying to construct an bulk emailer composer using the mailto html attribute.


set emMailto to "mailto:"
set emAdd to "testmail@testserver.com"
set emBody to "?body="
set emBodyText to "The%20message's%20first%20paragraph.%0a%0aSecond paragraph.%0a%0aThird%20Paragraph."
--set emBodyText to "The%20message's%20first%20paragraph."

set txtURL to emMailto & emAdd & emBody & emBodyText as string

open location txtURL

Objective:

  1. Create the mailto link with formatting to open up with the default email.

What Works:

  1. the commented part works
  2. Any message with no space.
  3. Any message with no “%0a” carriage return.

Issues:

  1. Applescript can’t handle text with spaces (
  2. Applescript can’t handle “%0a” carriage return.

Any help would be appreciated.

Hi,

What email client are you using. The following works for me with Mail.app:


set emMailto to "mailto:"
set emAdd to "testmail@testserver.com"
set emBody to "?body="
set emBodyText to "The message's first paragraph.
Second paragraph.
Third Paragraph."

set txtURL to emMailto & emAdd & emBody & emBodyText as string

tell application "Finder" to open location txtURL

John Maisey
www.nhoj.co.uk

thanks alot! :smiley: Exactly what I was looking for…

The key was this part I think.


tell application "Finder" to open location txtURL

also:
You can use (for more controlled formatting)


set emBodyText to "The message's first paragraph." & return & "Second paragraph." & return & "Third Paragraph."

instead of this

set emBodyText to "The message's first paragraph.
Second paragraph.
Third Paragraph."

The Finder tell block only seems to be necessary due to the returns. I’m not sure why that would be.

John M

thanks john.

Yeah I know it seems odd that it parses the default mailto formatting as text but I guess it take the string as text not as a true mailto link.