A straightforward way of sending email from within a SharePoint 2007 application is to use the Object Model. Here is some C# code that will do it for you:
bool isAppendHtmlTag = true;
bool isHtmlEncode = false;
string recipient = "whoever@whatever.com";
string title = "This is the title";
string body = "This is the email <strong>body</strong>";
Microsoft.SharePoint.Utilities.SPUtility.SendEmail(
Microsoft.SharePoint.SPContext.Current.Web,
isAppendHtmlTag,
isHtmlEncode,
recipient,title,
body);
No comments:
Post a Comment