but my code is as below
private bool SendEmail(strin g email)
{
try
{
using (MailMessage mail = new MailMessage())
{
string msgBody="";
string message = "";
//Load the template page for the email template.
BlogEngine.Core .Page page2 = BlogEngine.Core .Page.GetPage(n ew
Guid(Session["Content"].ToString() ));
//Take the link for the main content page and add it to the content.
Use HTML breaks.
msgBody = page2.AbsoluteL ink + "<br/>";msgBody += page2.Content + "<br/
>";
//Take the content for the email heading intro message. This is hard
coded guid for the virtual page in the admin we created for sending
the email
BlogEngine.Core .Page page = BlogEngine.Core .Page.GetPage(n ew
Guid("ff8f0685-9f6a-4758-855d-6018d9542963")) ;
message = page.Content;
// Add the 911 intro
msgBody = message + "<br/>" + msgBody;
//Email is from 911
mail.From = new MailAddress(Blo gSettings.Insta nce.Email);
//This should add fields from the form for the user's name and thier
MailAddress ma = new MailAddress(thi s.txtTo.Text,
this.txtFriends Name.Text);
mail.To.Add(ma) ;
mail.Subject = page.Title;
//page content includes html
mail.IsBodyHtml = true;
//mail.BodyFormat = System.Web.Mail .MailFormat.Htm l;
// AlternateView PlainView =
AlternateView.C reateAlternateV iewFromString(" This is my Plain text
Content, Viewable by those client that dont support html", null, "text/
Plain");
//AlternateView htmlView =
AlternateView.C reateAlternateV iewFromString(" <b>this is bold text, and
Viewable by those client that support html </b>", null, "text/html");
//mail.AlternateV iews.Add(PlainV iew);
//mail.AlternateV iews.Add(htmlVi ew);
mail.Body = msgBody;
//mail.BodyEncodi ng = System.Text.Enc oding.UTF8;
//mail.BodyEncodi ng.IsBrowserSav e = true;
//mail.Body = msgBody;
Utils.SendMailM essage(mail);
}
return true;
}
catch (Exception ex)
{
if (User.Identity. IsAuthenticated )
{
if (ex.InnerExcept ion != null)
lblStatus.Text = ex.InnerExcepti on.Message;
else
lblStatus.Text = ex.Message;
}
return false;
}
}
eventhogh i did mail.Isbodyhtml = true....
my email shows html tags in it i dont need that...how can i get that
do u hav any idea?