Mailsmith
 Other Programs
 Scripts
  Mailsmith.scpt
  Archive to sub-mailbox
  Check Spelling
  Find reply
  Change font size
  Submit Script to JEM
  Fix common spelling errors
  Setting SMTP server
  URL from Safari
  Address from AB
  linkMunge
  Export to Address Book
  Saving attachments
  Digest Script
  File with same
  POP window position
  Position of new windows
  iCal and Mailsmith
  Edit From Line
  Modified Thread Script
  Reply to Selection
  Temporary Text Window
  Compact gain
  Tracking backups
  Edit subject
  Googler
  Auto-rewrap
  MMA
  SMTP server
  Open, fetch, and close
  URL Manager
  BrainForest
  Thread by Author
  Thread by subject
  Export Email
  Get Selection
  Read Addresses
  Export Email
  Organize Email
  Account setup
  Mailsmith 2 BBEdit
  BBEdit 2 Mailsmith
  Search II
  Check One
  Delete Enclosure
  Open, fetch, close
  Set Answered
  Set Redirected
  Empty Trash
  List found
  Print Several
  Del. old. msg.
  Delete Enclosures
 Accounts
 Address Book
 Editing
 Filters
 General
 Import/Export
 Links
 Mailboxes
 Memory
 Scripting
 Speed
 send/receive
 Tips/Tricks
|
Change SMTP server |
| Author |
Jan Erik Moström
|
| Last modified |
2001-06-05
|
|
What is this?
Here is a script that I use daily. I've got a PowerBook and work at several different places, thanks to the location manager it's quite easy to change all the necessary settings ... all except the auto-check feature and the SMTP server of my email accounts in Mailsmith.
But since Mailsmith is so scriptable it's pretty easy to create an AppleScript that does this for me. I just call the script below each time I change location, select where I am, and the script does the rest.
The script checks to see if the account is a "Sendable" account before changing SMTP server, and also checks the time interval to see if the account should be autochecked or not (0 indicates that it shouldn't auto check).
The "nameList" property defines the places I select from, the "serverList" defines the name of the SMTP server for each location, and the "autoCheck" property defines if the account should auto check on a certain location. If you are going to use this script you will have to redefine these properties.
|
property nameList : {"Datavetenskap", "Hemma", "Humlab", "Telenordia"}
property serverList : {"mail.cs.umu.se", "mail.communique.se", "mail.umu.se", "smtp.tninet.se"}
property autoCheck : {true, false, true, false}
on changeISP(newSMTP, autoCh)
tell application "Mailsmith 1.1"
set availAccounts to mail accounts
repeat with ca from 1 to the number of items in availAccounts
set x to item ca of availAccounts
if can send of x then
set smtp server of x to newSMTP
end if
if connection interval of x ≠ 0 then
set auto checking enabled of x to autoCh
end if
end repeat
end tell
end changeISP
on run
set x to choose from list nameList with prompt "Choose new SMTP server" OK button name "Change" without multiple selections allowed and empty selection allowed
if class of x = list then
set sel to item 1 of x
repeat with i from 1 to the number of items of nameList
if item i of nameList = sel then
changeISP(item i of serverList, item i of autoCheck)
exit repeat
end if
end repeat
end if
end run
|