This is just a note that I have for using the email server specified in the SharePoint central admin.

StringDictionary headers = new StringDictionary();
headers.add("to","admin@test.com");
headers.add("cc","manager@test.com");
headers.add("bcc","user@test.com");
headers.add("from","myAddress@test.com");
headers.add("subject","How to use SendEMail from SPUtility");
headers.add("content-type","text/html"); //This is the default type, so isn't neccessary.

string bodyText ="This is the body of my email, in html format.“;

SPUtility.SendEmail(web, headers, bodyText);

MSDN Links :-

Advertisements