using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
using System.IO;
using Microsoft.SharePoint.Utilities;
using System.Collections.Specialized;
protected void Button1_Click(object sender, EventArgs e)
{
using (SPSite objSPSite = new SPSite("http://SP2010/")) //Site collection URL
{
using (SPWeb objSPWeb = objSPSite.OpenWeb("Home")) //Subsite URL
{
StringDictionary strDic = new StringDictionary();
strDic.Add("from", "microsoft@microsoft.com");
strDic.Add("to", "microsoft@microsoft.com");
strDic.Add("bcc", "microsoft@microsoft.com");
strDic.Add("subject", "Welcome to the SharePoint");
strDic.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;'>Welcome SP2010! </span>");
SPUtility.SendEmail(objSPWeb, strDic, strMessage.ToString());
}
}
}
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
using System.IO;
using Microsoft.SharePoint.Utilities;
using System.Collections.Specialized;
protected void Button1_Click(object sender, EventArgs e)
{
using (SPSite objSPSite = new SPSite("http://SP2010/")) //Site collection URL
{
using (SPWeb objSPWeb = objSPSite.OpenWeb("Home")) //Subsite URL
{
StringDictionary strDic = new StringDictionary();
strDic.Add("from", "microsoft@microsoft.com");
strDic.Add("to", "microsoft@microsoft.com");
strDic.Add("bcc", "microsoft@microsoft.com");
strDic.Add("subject", "Welcome to the SharePoint");
strDic.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;'>Welcome SP2010! </span>");
SPUtility.SendEmail(objSPWeb, strDic, strMessage.ToString());
}
}
}