Sample Header Ad - 728x90

Creating an account and sending mail using applescript

-1 votes
2 answers
1732 views
I'm trying to use applescript to do two things: 1. Create an account in Mail.app 2. 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
Asked by erictsai626 (1 rep)
Nov 14, 2014, 05:28 PM
Last activity: Jun 8, 2020, 08:19 PM