Create Mail account by AppleScript -> Authentication problem
For two day, I try to create a new email account in Apple Mail by using Apple Script. Actually, my script works fine except for the declaration of SMTP informations.
To my side, my SMTP server requires *authentication by password*.
----- CODE -----
tell application "Mail"
(* First, the IMAP account. Works flawlessly *)
try
set newacct to make new imap account with properties {name:"MailboxName", user name:"xxx@mycompany.com", password:"", uses ssl:true, server name:"xxx.mycompany.com", port:xxx, full name:"<Sender User Name>", email addresses:{"xxx@mycompany.com"}}
(* Next, we create a new SMTP server in the list. *)
set addsmtp to make new smtp server with properties {server name:"xxx.mycompany.com", user name:"xxx@mycompany.com", uses ssl:true, authentication:password, password:""}
(* End then, we attach the SMTP server to the new IMAP account. *)
set smtp server of newacct to addsmtp
end try
end tell
----- END CODE -----
When I launch this script, Mail starts, the IMAP account is created just like the SMTP server. BUT when I check it (MailboxName > right click > Modify "MailboxName" > Sending server (SMTP) > modify the SMTP server list > advanced) there is *<Do not localize>* message instead of the SMTP scrolling list.
When I restart AppleMail, there is the list but only with " xxx.mycompany.com" instead of " xxx.mycompany.com:xxx@mycompany.com".
I check the advanced properties of the new SMTP server and Authentication parameter is set to "None".
*I've tried "authentication:md5", it works !*
Does anyone have an idea ?
If you need further information, please let me know.
Regards,
Florent.
ps : I haven't found AppleScript forum. Sorry if this post is not in the right place 🙂
Macbook Pro 15", Mac OS X (10.6.2)