Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
5
Reply
Send email using email utitlity
Gowtham
Aug 2 2017 6:59 AM
206
Reply
I was working on sent email using server object model.
The code runs perfectly but I am missing something to configure.Also I configured smtp server in local host but I can't relate anything.
On out going email settings:
Outbound SMTP server:WIN-LP2NAII0NV
From address:
[email protected]
To address:
[email protected]
codes were tried
using (SPSite oSPSite = new SPSite("http://win-l9p2naii0nv:10001/")) //Site collection URL
{
using (SPWeb oSPWeb = oSPSite.OpenWeb()) //Subsite URL
{
StringDictionary headers = new StringDictionary();
headers.Add("to", "
[email protected]
");
headers.Add("subject", "Welcome to the SharePoint");
headers.Add("fAppendHtmlTag","True"); //To enable HTML format
System.Text.StringBuilder strMessage = new System.Text.StringBuilder();
strMessage.Append("Message from CEO:");
strMessage.Append("<span style='color:red;'> Make sure you have completed the survey! </span>");
SPUtility.SendEmail(oSPWeb, headers, strMessage.ToString());
}
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
Uploading a document to sharepoint url with query parameters
In SharePoint Online Infopath Form : User Profile Issue