By: Neil Barkhina
If you’ve set up a SharePoint 2010 development environment, one of the first things you will want to do is get e-mail working. E-mail is an important tool of any SharePoint developer, however getting this to work in SharePoint 2010 is not the most trivial of tasks. Also based on how you have chosen to set up your environment, there are a number of different strategies:
1. SharePoint 2010 environment on Windows Server 2008 joined to an existing domain
2. SharePoint 2010 environment on Windows Server 2008 Domain Controller
3. SharePoint 2010 on Windows 7
I will talk about scenario two in a later blog post. What makes scenario two interesting is the fact that Windows Server 2008 no longer includes an out of the box POP3 service. For this reason, it will be necessary to install your own POP3 from a third party. There is a free one from Visendo that will do the trick. This is better than installing Exchange on a development server, especially if you are running your environment on a laptop with a virtual machine. SharePoint 2010 is very resource heavy, and installing Exchange would just make it run even slower. And we want our VMs running fast, right?
So for this blog post I am going to focus on scenario one, because it is one of the simplest but not without its roadblocks. I chose to join my development environment to my company domain because it was a quick and dirty way to get up and running developing SharePoint solutions. I could easily give access to my work colleagues, and I didn’t have to deal with all the burdens of installing and setting up Active Directory. Luckily for me, we already have Exchange running in our organization. So I went ahead and pointed it there:
So here I’m thinking, I’m done right? Wrong! I went ahead and added myself to a SharePoint with the trusty welcome e-mail, and waited…. Nothing! No email :( So apparently the problem was SharePoint didn’t have an e-mail address associated with my login account. The way to solve this is to go into your User Profile Service Application and configure a profile import. Now, if you’ve ever set up User profile sync in SharePoint 2010 you probably know that it is quite a difficult task. Also, if your development environment is running on your production organizational Active Directory, you may not even want to do a Profile Synchronization because of the sheer volume of data and security concerns. So what I did was manually set the e-mail address in my site. The way I chose to do this is by writing a quick Visual Studio Application. Remember to set it to .NET Framework 3.5 and also make sure you are targeting x64. Add a reference to Microsoft.SharePoint.Dll and you should be ready to go. The entire code is very simple:
All it is doing is opening up the site you wish to test against, and setting the email. If you go into My Settings, you should now verify that the correct e-mail address is displayed:
So after this, I went ahead and added myself to the site again and behold everything worked!! Well I hope this is helpful to some folks out there. Check back soon to see how POP3 can be set up on Windows Server 2008.
By: Neil Barkhina