I'm trying to use applescript to do two things:
- Create an account in Mail.app
- Using that account, send an email in Mail.app
I'm having an issue with creating an account on Mail.app mainly because theres no "SMTP server", and I'm trying to use Yahoo. No matter what I try, I can't get Applescript to automatically add yahoo as the smtp outgoing server. Here's my code:
tell application "Mail"
set AccountName to "account_name"
set newacct to make new pop account with properties {name:AccountName, user name:"account_name@yahoo.com", server name:"mail.yahoo.com"}
tell newacct
set password to "ThePassword"
set full name to AccountName
set email addresses to {"account_name@yahoo.com"}
set port to 995
set uses ssl to true
end tell
set addsmtp to make new smtp server with properties {server name:"smtp.mail.yahoo.com", user name:"account_name@yahoo.com"}
tell addsmtp
set password to "ThePassword"
set uses ssl to true
set port to 465
end tell
set smtp server of newacct to addsmtp
end tell
set smtp server of newacct to smtp server addsmtp
– tubedogg Nov 14 '14 at 17:54