using applescript to autorespond to reply-to

Hi - I’ve searched fruitlessly for a solution to my problem, and hopefully someone here can point me in the right direction.


I receive business referrals to my email via two online forms, both come from no-reply addresses. Autoresponders won’t reply to the reply-to address (the person who filled out the form). I would ideally like an autoresponder that runs while Mail is open on my iMac at home, and when an email is received from either of those two no-reply addresses, the script replies to the reply-to address with a message that includes a hyperlink to my online patient portal.


Possible? I’ve worked with AppleScript just a little and the automator, but way over my paygrade! This is for business, so I’m willing to pay for a solution if it exists.


Thanks in advance.

iMac, iOS 12.1

Posted on Nov 5, 2018 11:41 AM

Reply
Question marked as Top-ranking reply

Posted on Nov 11, 2018 2:41 PM

This shouldn't be hard at all.


Save this script as a mail rule script in ~/Library/Application Scripts/com.apple.mail

Then setup a Mail rule to trigger this script to run when messages from the addresses in question arrive:


use AppleScriptversion "2.4" -- Yosemite (10.10) or later

use scripting additions


property myMessageBody : "Your message goes here"



using terms from application "Mail"

on perform mail action with messagesmessageListin mailboxesmboxfor ruleaRule

repeat with eachMessage in messageList


-- make a new message

tell application "Mail"

set newMessage to (makenewoutgoing messagewith properties {subject:"new mail", content:myMessageBody})

tell newMessage


makenewto recipientwith properties {address:reply to of eachMessage}

end tell


sendnewMessage

end tell

end repeat

end perform mail action with messages

end using terms from

Similar questions

2 replies
Question marked as Top-ranking reply

Nov 11, 2018 2:41 PM in response to armorton

This shouldn't be hard at all.


Save this script as a mail rule script in ~/Library/Application Scripts/com.apple.mail

Then setup a Mail rule to trigger this script to run when messages from the addresses in question arrive:


use AppleScriptversion "2.4" -- Yosemite (10.10) or later

use scripting additions


property myMessageBody : "Your message goes here"



using terms from application "Mail"

on perform mail action with messagesmessageListin mailboxesmboxfor ruleaRule

repeat with eachMessage in messageList


-- make a new message

tell application "Mail"

set newMessage to (makenewoutgoing messagewith properties {subject:"new mail", content:myMessageBody})

tell newMessage


makenewto recipientwith properties {address:reply to of eachMessage}

end tell


sendnewMessage

end tell

end repeat

end perform mail action with messages

end using terms from

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

using applescript to autorespond to reply-to

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.