Installing and Configuring SMTP and POP3 E-Mail For Sharepoint 2010
Installing and Configuring SMTP and POP3 E-Mail For Sharepoint 2010
sharepoint 2010
Introduction
After having installed a development environment we can complete our installation by installing and
configuring SMTP and POP 3 service on our Virtual machine.
Developer benefits (the "Why" part of the post)
It would be interesting to have a way to send and receive e-mails inside our development environement in
order to:
The Web Server IIS Feature Wizard is opening since as you will see later, the SMTP Server configuration
has to be done within the old IIS 6.0 console.
On Select Role Services Windows, let the default option (while I was tempted to check WebDav to be
able to navigate through my SharePoint 2010 folders using Front Page RPC and WebDav protocols after
having added a network place for a SharePoint site. But I had the pleasant surprise to discover it was
already working, and I think it is thanks to Visual Studio 2010 installation...)
Validate the page of Confirm Installation Selection
This is the screen you should have after the installation of your SMTP Server Feature on your Windows
2008 Server R2 environment
3 - Configuring the SMTP server
As said before, the SMTP Server is configured using the old IIS 6.0 Microsoft Management Console, so
open it:
We are now going to create a domain alias for our machine.
If you reopen the Relay Restrictions dialog you should obtain this:
4 - Installing a third party free POP 3 service
As posted by Chris Stinson, while SMTP is alive and well in the Features section of the Windows 2008
Server Manager, POP3 has been removed from Windows 2008 altogether. Fortunately, Chris has also
given a reference to a third party free solution:
Visendo SMTP (pop3) Extender for Windows 2008 Server
You will find the link to the 64 bits version, download it and start the installation
5 - Configuring our POP 3 service
To enable the Visendo SMTP (pop3) Extender for Windows 2008 Server do the following.
Assume we are wanting to create a mailbox for an account the e-mail address of which is
[email protected]...
Start creating a folder at this location:
C:\inetpub\mailroot\Drop\administrator_contoso_com
Then, locate the visendosmtpextender.config and open it. It is located at:
c:\Users\All Users\ppedv\visendosmtpextender
and the server information linked to this account in the second dialog
Close the last dialog that confirms the successful creation of the administrator email account
7 - Testing e-mail sending and receiving
Now, we just have to test if all is working properly.
As you should be signed in within Windows Mail as [email protected], try to send an e-mail to
this account.
Start several sync operations. Do not worry, it can take few minutes until...
Well done!
We can now use all e-mail functionalities offered by SharePoint 2010 in our Windows server 2008 R2
development environment.
8 - Configuring incoming e-mail settings (SharePoint 2010 - local service
accounts)
Now is the time to configure incoming e-mail settings for our environment ie a development machine
using local accounts. So the configuration will be very easy since we will not have to manage with
settings linked to Active Directory.
So open the SharePoint 2010 Central Administration and click on System Settings.
Then, on the System settings page, on the configure incoming e-mail settings link
10 - Giving an e-mail address to the local users accounts
Now, we want to test what we have configured, but to do it, we need user accounts with an available e-
mail address . Unfortunately, as we are using local accounts, when we have registered them in the
SharePoint content databases, there were no way at this time to automatically obtain an e-mail address
from an Active Directory or an LDAP. To do this, while we could use the SharePoint 2010 UI by editing
each account properties, I will rather take advantage of this operation to show how easy it is to program a
fast sharePoint 2010 configuration task using the SharePoint object model. By the way, imagine you have
to do this operation for 1000 local service accounts...
So open Visual Studio and create an aspx file in the layouts directory under the 14 hive. Assume we call it
setEmailAddress.aspx
Here is the code of our SharePoint 2010 application page:
<%@ Page Language="C#" AutoEventWireup="true"
Inherits="Microsoft.SharePoint.WebControls.LayoutsPageBase"
DynamicMasterPageFile="~masterurl/default.master" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead"
runat="server">
</asp:Content>
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
<script runat="server">
<%
message += "<br/><br/>Giving the users an e-mail address...<br/>";
myWeb.AllowUnsafeUpdates = true;
foreach (SPUser anUser in myWeb.AllUsers)
{
userName=anUser.Name.ToLower();
userName=userName.Remove(0,userName.IndexOf(@"\")+1);
anUser.Email = userName + "@contoso.com";
anUser.Update();
message += "<br>" + anUser.Email + " was sucessfully attributed";
}
}
lblMessage.Text = message;
%>
<asp:Label id="lblMessage" runat="server" />
</asp:Content>
<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle"
runat="server">
Set Users e-mail address
</asp:Content>
<asp:Content ID="PageTitleInTitleArea"
ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
Set users e-mail address
</asp:Content>
This is the way of quickly configuring Sharepoint while programming against the SharePoint 2010 object
model. A simple application page with two page directives, and here you are, you have the intellisense
and can start driving your SharePoint 2010 environments by writting HTML and C#. You will notice by the
way that this 2 page directives are also enough to obtain a SharePoint 2010 application page with all the
required presentation elements. Let us call it the SharePoint 2010 minimal Application Page.
Now execute the page and you should obtain something like this:
We can now check that our users were actually provided with an e-mail adress:
11 - Testing Incoming e-mail settings for a SharePoint 2010 list with local
accounts
Create a discussion list in a sharePoint 2010 site, assume we call it forum. As we have enabled incoming
e-mail at the Farm level, a new configuration parameter appear in the list settings:
Now, if we provide the "forum" list with an incoming e-mail address, users will be able to contribute to the
list by sending e-mail to this address, and the authentication will be based on their e-mail address.
12 - Testing outgoing e-mail settings for a SharePoint 2010 list with local
accounts
now assume we had configured an e-mail alert for our other account, the Administrator one, he should
have received a message about the previous e-mailed contribution.
And it is done!