- Open Visual Studio 2010 by going Start | All Programs | Microsoft Visual Studio 2010 | Right click on Microsoft Visual Studio 2010 and click on Run as administrator.
- Go to File tab, click on New and then click on Project.
- In the New Project dialog box, expand the Visual C# node, and then select the Windows node.
- In the Templates pane, select Console Application.
- Enter the Name as SendEmailand then click OK.
- In the solution explorer, right click on the solution and then click on Properties.
- Select the Application tab, check whether “.Net Framework 3.5” is selected for Target Framework.
- Select the Build tab, check whether “Any CPU” is selected for Platform Target.
- Add the following references
Microsoft.SharePoint
- Add the following namespaces
using Microsoft.SharePoint;
using System.Net.Mail;
- Replace Program.cs with the following code
|
Output:


Gowtham RajamanickamPosted Apr 10, 2016, 8:18 AM
simply super
Gowtham RajamanickamPosted Apr 10, 2016, 8:18 AM
Cool
Vinodh NarayananPosted Aug 23, 2015, 10:28 AM
cool
Ramya SVPosted Mar 28, 2013, 6:50 AM
Hi Vijai, I am getting the following Error. "Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it ipaddress:portnumber" Please help me in resolving this.