I’m using applescript and Apple mail to send email, I need it sent from a specific account and I’m having trouble setting the from account or sender:
set account to account "Google"
gives me this error:
224:242: syntax error: Can’t set «class mact» to «class mact» “Google”. Access not allowed. (-10003)
I have verified that the account exists, I get the same error with:
set account to the first account
set sender to "<my email address>"
doesn’t affect the sender in any way that I can see.
Any help or suggestions?
(Yosemite)
thanks
full code:
tell application "Mail"
tell (make new outgoing message )
set subject to "subject"
set content to "Add your message here\n\n"
set visible to true
-- set sender to "<my email account>"
set account to account "Google"
make new to recipient at end of to recipients with properties {address:"$mailTo", name:"Name" }
end tell
end tell