Use Applescript to set the "Reply-To" address
I have a registered domain, and I use hushmail as a mail provider. I'd
like to send emails from Mail.app as if they were sent from my domain. The
Hushmail SMTP server does not allow me to use a different "from" address
than my account name, for security reasons (spam).
I found a way to have Apple mail fill the reply-to mail with a default all
the time, here:
http://email.about.com/od/macosxmailtips/qt/etalwaysreplyto.htm but that's
too drastic for me, as I have multiple mail accounts in my mail client.
In Mail.app, I can set the "Reply to" field manually, but there is no way
to gracefully have that automatically filled based on the mailbox I
select.
So far, I have an AppleScript which is able to create a reply on the
selected mail:
tell application "Mail"
set theSelection to selection
if theSelection is {} then return
activate
repeat with thisMessage in theSelection
set theOutgoingMessage to reply thisMessage with opening window
# Wait for Mail.app to create the reply window
repeat until exists (window 1 whose name = "Re: " & subject of
thisMessage)
end repeat
delay 0.1
#
# Here I want to set the reply-to address here based on the
# selected mailbox, or the "from" address of
# the current mail.
#
#
# The I need to restore the cursor to the body of the mail
# (if cursor was moved)
#
end repeat
end tell
I've looked in the AppleScript Dictionary (File -> Open Dictionary ->
Mail.app -> Message -> message -> reply to), and this seems to be a
property I should be able to set, but when I do something like:
tell theOutgoingMessage
make new recipient at end of reply to with properties
{address:"myreplyto@example.com"}
An error pops up saying "Mail got an error: Can't get reply to of outgoing
message id 65."
How can I set the reply-to property of the reply mail I just created?
No comments:
Post a Comment