TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Gowtham
NA
516
41.1k
Send email using email utitlity
Aug 2 2017 6:59 AM
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());
}
}
Reply
Answers (
5
)
Uploading a document to sharepoint url with query parameters
In SharePoint Online Infopath Form : User Profile Issue