scripting question

15 views
Skip to first unread message

Henri

unread,
Mar 9, 2013, 5:28:11 PM3/9/13
to mailsmi...@googlegroups.com
I change SMTP servers on occasion with the help of a script:

set the_server to "smtp.gmail.com"
set the_user to "x...@gmail.com"
set the_password to "yyy"
set the_port to 465
tell application "Mailsmith"
    set n to count mail accounts
    repeat with i from 1 to n
        set smtp server of mail account i to the_server
        set use smtp authentication of mail account i to true
        set require SSL for SMTP of mail account i to true
        set smtp user of mail account i to the_user
        set smtp password of mail account i to the_password
        set smtp server port of mail account to the_port
    end repeat
end tell

I'd like to change that so as to use a different user and password for different accounts. Can I assume that the accounts are numbered in the order they appear in the Accounts window? Or is there a way to address them by name (which seems safer)?

--Henri

Charlie Garrison

unread,
Mar 10, 2013, 8:29:09 AM3/10/13
to mailsmi...@googlegroups.com
Good evening,

On 9/03/13 at 2:28 PM -0800, Henri <hpicc...@gmail.com> wrote:

>I'd like to change that so as to use a different user and password for
>different accounts. Can I assume that the accounts are numbered in the
>order they appear in the Accounts window? Or is there a way to address them
>by name (which seems safer)?

tell application "Mailsmith"
set myAccount to (first mail account whose name = "Account Name")
set login of myAccount to "us...@example.com"
set password of myAccount to "abcd"
end tell

Look at the Mailsmith dictionary for more properties.


Charlie

--
Ꮚ Charlie Garrison ♊ <garr...@zeta.org.au>

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

Henri

unread,
Mar 10, 2013, 10:43:01 AM3/10/13
to mailsmi...@googlegroups.com
Thank you!
Reply all
Reply to author
Forward
0 new messages