Hello all
I have an auto-responder (of sorts) set up via a Rule which runs an Applescript when i receive an email that meets the criteria. Basically its to automatically send an email when i am paid for an item via paypal.
The script is here:
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
tell application "Mail"
repeat with eachMessage in theMessages
set theName to extract name from sender of eachMessage
if exists reply to of eachMessage then
set theAddress to reply to of eachMessage
else
set theAddress to extract address from sender of eachMessage
end if
set newMessage to make new outgoing message
tell newMessage
make new to recipient at end of to recipients with properties {name:theName, address:theAddress}
set visible to false
set subject to "SUBJECT OF EMAIL"
set content to "CONTENTS OF EMAIL"
end tell
send newMessage
tell eachMessage
set was replied to to true
end tell
end repeat
end tell
end perform mail action with messages
end using terms from
It works rather well.
I have the rule set up to only pick up emails on ONE of my accounts (my paypal email account, which makes sense). I obviously want it to reply WITH this account also (theres no point in receiving their notification of payment, then replying with my .mac account for example).
When testing it just now, it seemed to pick an account at random, and sent it with my .mac account, even though it was replying to an email in my googlemail account, as specified by the rule. Then when i tested it again, it used my googlemail account. it’s rather wierd.
Is there a way to alter the script to FORCE it to reply with the googlemail account?
And whilst I’m here can it be streamlined in anyway?
Many, many thanks everyone.