SharePoint: Incoming mail in a development environment

Tags: SharePoint 2013, Mail

If you’re cutting any code for SharePoint, you’ve probably got yourself a nice standalone VM with everything isolated and working just about so.

So, what happens when that rare project comes in where you need to work with incoming mail and need to test/mock it?

There are plenty of articles out there for testing outgoing mail and most point to smtp4dev.

Incoming mail is however a little more complex, or so it seems.  In our development environment we probably don’t want to think about exchange and all the baggage that comes with it.  We want it all isolated.

Follow through the below technet article to set up the SMTP service and incoming mail on SharePoint, its not worth going through it all again here.

Extra steps I did in this was to:

  1. Create an alias in IIS6 SMTP domains, just a vanity thing! 
  2. Update the hosts file to make sure this new alias points to 127.0.0.1
  3. Make sure I use my new alias when setting up incoming mail in SharePoint CA.


http://technet.microsoft.com/en-us/library/cc262947(v=office.15).aspx

Now, we have the SMTP setup on our local machine, but we don’t want to mess around with Exchange or DNS etc, so we’re going to simply force outlook to use the local box as the SMTP server.

Open up outlook, create a new account, setup manually and select POP.

In the SMTP Outgoing mail settings simply put in the alias name.

The import one is to uncheck “Automatically test account settings when Next is clicked”.

It really doesn’t matter about the username or password (unless you have for some reason setup auth in your SMTP settings).

You will keep getting a prompt saying that Outlook can’t connect to the incoming mail server, if you really care about this, you can simply add a real life pop account for the incoming (obviously it’ll start downloading all the mail in that account!).

Something like this and you’re good to go…

(sp2013.com is the alias I setup for my dev server)

image

Hope this helps.




comments powered by Disqus