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

Use multiple SMTP servers with one email address in Mail.app Apps
For a long time, my partner could not use Mail.app full time because she has to be able to have alternate SMTP servers for work and home. She wants to be able to send an email from her "home account" by using the SMTP server at work when she is at work, and by using our ISP's SMTP server at home. The problem is that Mail.app will not let you set up two accounts with the same email address. The alternatives: to manually edit the preferences when switching from home to work, or to attempt a send to the wrong SMTP, fail and then select an alternative server. Neither of these could be described as elegant solutions.

However, with a text editor and the mail.plist file (found at ~/Library -> Preferences -> com.apple.mail.plist), you can do a little XML editing to set up an alternate account with the same email address but different SMTP servers. Here's how...

First make a duplicate of your com.apple.mail.plist file. If you don't make a duplicate and you screw up your mail prefs, forget where you read this. Use a text editor to find the account you wish to duplicate (identified after the AccountName Key), and duplicate everything between the appropriate <dict> and <dict> XML tags (inclusively).

Now locate the key AccountName in the duplicate (it should be the first line). In the following <string> line, change the name of the account to something that will reflect usage (eg myaccount - home).

Locate the key for AccountPath and change its string to a different path. For example, if it were ~/Library/Mail/POP-me@myemail.ca, append (alt) to the end. Mail will create the directory and mailboxes in the filesystem if and when it needs to.

Now locate key for SMTPIdentifier and change its string to the identifier of an existing SMTP server (should be the identifier that you have added via mail preferences window).

Next, locate the key for FullUserName and change its string value to something that will distinguish the account in the new message's account popup menu.

Finally, you will want to tell Mail to not fetch mail for this alternate account -- the original will be fetching mail; this is just so you can have use this email address with an alternate smtp server. After the Key and string pair for AccountType, add the following key and string lines:
<key>AutoFetch</key>
<string>NO<string>
Save your plist file and start Mail. Now when you create an email, you should see your alternate account in your Account: popup menu. This will send your email via your alternate SMTP server, but using your regular email return address.

Note that you will not be able to edit the alternate account in the preference window as it will tell you that you cannot have two accounts with the same email address.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[16,042 views]  

Use multiple SMTP servers with one email address in Mail.app | 19 comments | Create New Account
Click here to return to the 'Use multiple SMTP servers with one email address in Mail.app' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use multiple SMTP servers with one email address in Mail.app
Authored by: Kool on May 16, '03 11:14:35AM

Why don't you just add a second smtp-server to the e-mail account? Then if your wife ain't at work the Mac won't be able to find the smtp-server and asks if it's ok to use the other smtp-server. This is asked only once for every session. Quite handy: only one click and no fiddling around with pref files.



[ Reply to This | # ]
Use multiple SMTP servers with one email address in Mail.app
Authored by: pmreiz on May 16, '03 11:36:31AM

I use an app called LocationX to accomplish this SMTP server change, along with a host of other preference changes all at the same time. It's a handy little app that I use each and every day.



[ Reply to This | # ]
Use multiple SMTP servers with one email address in Mail.app
Authored by: gohliangsong on May 18, '03 08:25:50AM

I agree. I do this myself because I use my iBook both at home and at the university and Mail.app just complains and then tries the other SMTP server setting, which just works. You can set this just by changing the Preferences and then editing the account and adding additional Outgoing Mail Servers. No need for any 3rd-party software or editing the plist files.



[ Reply to This | # ]
Use multiple SMTP servers with one email address in Mail.app
Authored by: digitaltvguy on May 16, '03 11:46:40AM

You can also use MailSwitch (http://home.earthlink.net/~borsoft/mailswitch.html) which will allow you to switch MAIL.app "locations". It has worked flawlessly for me (over 8 months).

---

-Chris



[ Reply to This | # ]
Use multiple SMTP servers with one email address in Mail.app
Authored by: feste on May 16, '03 11:52:57AM

Okay, I don't use Mail, so I'm not sure if my application is the latest version or not, but in version 1.2.3, if you go into the preferences and go to the Accounts pane, the option "Outgoing Mail Server" for each account is A POP-UP MENU OF SMTP SERVERS. The bottom choice on the menu is to create a new entry.

So, what's the problem? Why is this hint necessary?



[ Reply to This | # ]
Use multiple SMTP servers with one email address in Mail.app
Authored by: ravigv on May 16, '03 12:16:38PM

There is a much simpler (or less technical) way of achieving the same effect, unless I'm missing something.
1) Go to preferences and create a new account.
2)Choose a unique & appropriate description, but fill the email Address and full name sections out as per your original account.
3)Makeup an Incoming mail server, eg fake0.
4) fill in user name and password anyway you like.
5) Create or choose your alternate smtp mailserver.

Bingo, Your alternate account without a text editor. (This is also the solution if you have multiple aliases for the one email account.)

Mail will not let you have two accounts with the both same incoming-mail-server & username because this is what it uses for the mailbox folder/name. It will let you have two accounts with the same email address for reply-to.

The only caveat is that the original text editor version may work better if the SMTP server requires pop-authentication.



[ Reply to This | # ]
Step 6 Very Important
Authored by: ravigv on May 16, '03 12:20:52PM

OOOPS...
6) Go to the Advanced Tab and unselect "Include when automatically checking for new mail".
7) click OK



[ Reply to This | # ]
Use multiple SMTP servers with one email address in Mail.app
Authored by: macandrew on May 16, '03 12:34:19PM

Anothe solution: obtain and use Location X, a shareware Location Manager that is equivalent to the OS 9 function. Not only can you use it to change SMTP servers, but much else besides. http://homepage.mac.com/locationmanager/



[ Reply to This | # ]
Use multiple SMTP servers with one email address in Mail.app
Authored by: smorr on May 16, '03 12:41:59PM

Thanks for the feed back. It seems that when I do this I get an error message that this mailbox is already in use and it doesn't let me create the account with a existing email address. Hence my technical workaround. Could this be a problem within my mail.app?



[ Reply to This | # ]
Why you are geting email address conflicts...
Authored by: ravigv on May 16, '03 01:58:22PM

Don't know is the short answer. Mail.app 1.2.5 seems only interested in the mail account directories being unique (~/Library/Mail/for@example)

My mail.app creates mail folders called <username>@<incoming mail server> which doesn't have to be the email address. So when I follow the steps above substituting "fake" for the incoming mail server, the username & the password it will check for a folder called "fake@fake" rather than the email address ie. somebody@swiftdsl.com.au.

Infact even if I duplicate two accounts exactly and just change the account directory (under the advanced tab - only possible when you first create an account) it will let me create the account, and only igve me a warning about the host/user names being the same.

Anyway Joshua's alternate solution certainly seems the more elegant than mine anyway, but then I am working with aliases not multiple smtp servers so it doesn't really help me.



[ Reply to This | # ]
Use multiple SMTP servers with one email address in Mail.app
Authored by: Joshua on May 16, '03 01:28:03PM

IMHO there is an easier way to change SMTP server.
You just have to create two (or more) different Locations with Network preference and specify your Domain Name (aol.com if you are connecting from home, or apple.com if you work at Apple :-)
Open Mail.app and specify as SMTP server just "mail". Usually ISP SMTP server name sounds like "mail.mickeymouse.com". If your ISP SMTP server has a different name you can add "mail.mickeymouse.com" to your hosts file (/etc/hosts) using real SMTP server IP address:

127.0.0.1 myMac
195.1.1.1 mail.mickeymouse.com

Every time you change Location using Apple Menu your SMTP server will change without modifing any Mail.app preference



[ Reply to This | # ]
Use multiple SMTP servers with one email address in Mail.app
Authored by: phixus on May 16, '03 01:54:55PM

Actually, modifying the entries in /etc/hosts won't work.

On Mac OS X /etc/hosts is only read during boot time. All other host lookups are managed by lookupd and NetInfo. This is clearly stated in the comment at the top of /etc/hosts.

You need to make the host entries in /Applications/Utilities/Netinfo Manager



[ Reply to This | # ]
Use multiple SMTP servers with one email address in Mail.app
Authored by: Joshua on May 16, '03 02:56:04PM
In MacOS 10.2.x hosts file is active, even if comment say it works olny in single user mode, as reported in this hint

[ Reply to This | # ]
Use multiple SMTP servers with one email address in Mail.app
Authored by: mscheurer on May 16, '03 07:04:32PM

You might want to try Mail Scripts <http://www.macupdate.com/info.php/id/9178> it includes a script to change predefined SMTP servers.



[ Reply to This | # ]
Use multiple SMTP servers with one email address in Mail.app
Authored by: sfn on May 17, '03 10:11:20AM

Actually if the two servers start with the same subdomain, ie. smtp. or mail. then just fill in smtp or mail and put the appropriate domain in the Network pref in "Search Domains" for each location.

---
-sfn



[ Reply to This | # ]
Try Sendmail
Authored by: Power Factor on May 16, '03 08:35:10PM

If you enable sendmail you will be able to send mail without the need for either smtp server.



[ Reply to This | # ]
Try Sendmail
Authored by: davidduff on Jul 06, '03 02:38:53AM

i did this for a while and thought that it had solved all my problems.

however, what i have found in the last month or two is that i am now unable to send mail to many addresses using my own sendmail process. the reason: many major isp's (including, for example, aol and pobox.com) will not accept any mail send which comes from an ip address that they perceive to be from a block of dynamically assigned addresses. the result: local sendmail simply doesn't work for many email addresses i typically find myself sending to.



[ Reply to This | # ]
Try Sendmail
Authored by: victorysshadow on Sep 25, '04 06:46:43PM

How do you enable sendmail in OS X Server? PLEASE? My form mailer stopped working and I think it might be the reason. Thanks.



[ Reply to This | # ]
Use multiple SMTP servers with one email address in Mail.app
Authored by: fixmacs on Jun 16, '05 07:34:32PM

None of the above measures are necessary to send mail from your "Home" account from work or almost anywhere else. It' s incredibly simple. No AppleScripts or third-party hacks are required.

Edit your SMTP server settings for auththentication. Done.

That's right, you're done. Contact your e-mail provider. Ask them for the "Authenticated SMTP settings" for your e-mail account using the designated alternative port (not the default port 25. this is often port 587, but not universally), then enter those setting in Mail.app. Configure your account for authenticated SMTP once, and you can send mail from home, or work, or Aunt Matilda's house at your convenience. You're done.



[ Reply to This | # ]