Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'An AppleScript to switch Mail's SMTP servers' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to switch Mail's SMTP servers
Authored by: jdborchert on May 17, '05 04:51:56PM
I wrote a similiar script to deal with my situation. I am a graduate student at the University of Utah. When on campus I must send email without SMTP authentication. When off campus I must use authentication. I set up two different SMTP servers in mail, one with and one without authentication. This script checks my IP address and if I am on the campus network it sets the SMTP server to the one without authentication and if I'm not on the campus network it sets the SMTP server to the one with authentication. I then saved it as an application and put it in my login items so I don't ever have to hassle with changing the server to send mail again!

set check_ip to do shell script "ipconfig getifaddr en0" as string
if check_ip starts with "155.100" then
	tell application "Mail" to set smtp server of account "Account Name" to smtp server "Server Name (without auth)"
else
	tell application "Mail" to set smtp server of account "Account Name" to smtp server "Server Name (with auth)"
end if


[ Reply to This | # ]