Outlook and outgoing SMTP servers

I have just moved and changed my ISP to one that not only blocks port 25 but also only allows their SMTP relay server to be accessed from within their own network.

When I’m at home with my laptop I have set my outgoing SMTP server as smtp.myhome-isp.com and all is fine. But when I want to work out of my office I have to change it (for all my seven accounts) to smtp.myoffice-isp.com.

I looked and asked around for some smart solution to this problem but found none except the advice to setup my own mailserver or subscribe to a mailserver service.

So, I did the same thing that I did years back when I had the same ISP (and the same problem) – I created two hosts files where I put the IP adresses to respective ISP’s SMTP relay servers. (The hosts file is where your computer goes before it goes out to the DNS to lookup an ip adress.)

  1. Goto c:\windows\system32\drivers\etc and make two copies of the hosts file and call them for example hosts.myhome-isp and hosts.myoffice-isp
  2. Edit the files and add an entry to each file for your home and office isp’s SMTP relay servers and add the hostname as mailout. You have to enter the IP address of the SMTP relay server (eg 10.10.10.1 not smtp.myhome-isp.com) if you don’t know it do a ping or nslookup to find out.
  3. On the desktop (or a location of your choice) create two new batch files, eg. MyHome ISP SMTP.cmd and MyOffice ISP.cmd and add these three lines of code to each:

    cd c:\windows\system32\drivers\etc\
    copy hosts.myhome-isp hosts
    pause

    (Line two above should read “copy hosts.myoffice-isp hosts” for MyOffice ISP.cmd)

  4. In Outlook set outgoing SMTP server to mailout

Whenever you move from home to the office run MyOffice ISP.cmd and vice versa. It may not be the ultimate solution but it works (at least for Outlook 2003 and 2007)

One Reply to “Outlook and outgoing SMTP servers”

  1. We fixed this problem for our clients by binding sendmail to port 5190 as well as 25. There is already a sendmail option for this: O DaemonPortOptions=Name=MTA5190-v4, Family=inet, Port=5190
    It may be a coincidence but as far as I know AOL instant messenger runs over port 5190 as well hence why your ISP wouldn’t want to block it. Whenever we have a client who’s ISP blocks port 25, we have them change the outgoing port number to 5190. Works like a charm every time!

Leave a Reply

Your email address will not be published. Required fields are marked *