在我的網絡應用程序中,當用戶發送有關該網站的任何評論時,該消息將發送到我的郵件(即[email protected])。雅迄今爲止工作正常,但當我點擊此轉發給任何人(在[email protected]轉發選項)它顯示與<html><body>
標籤。我該如何解決這個問題。在asp.net中發送郵件?
private void sendingmail()
{
string filename = FileUpload1.FileName.Trim();
string a = "http://www.begoniainfosys.com/Re/" + filename;
//string emailid = emailid.ToString();
MailMessage m = new MailMessage();
m.Subject = "Uploaded Resume";
if (txtdesc.Text.ToString() == "")
{
m.Attachments.Add(new System.Net.Mail.Attachment(@Server.MapPath("~/Resumes/" + FileUpload1.FileName)));
m.Body = "<html><body><b>" + "The Name Of The JobSeeker:" + txtname.Text + "<br><br>" + "The MailID:" + txtemailid.Text + "<br><br>" + "The MobileNumber:" + txtmobile.Text + "<br><br>" + "The Postion Applied For:" + txtpositionapplied.Text + "</b> </body></html>";
m.IsBodyHtml = true;
}
else
{
m.Attachments.Add(new System.Net.Mail.Attachment(@Server.MapPath("~/Resumes/" + FileUpload1.FileName)));
m.Body = "<html><body><b>" + "The Name Of JobSeeker:" + txtname.Text + "<br><br>" + "The MailID:" + txtemailid.Text + "<br><br>" + "The MobileNumber:" + txtmobile.Text + "<br><br>" + "The Postion Applied For:" + txtpositionapplied.Text +"<br><br>"+"The Description:"+txtdesc.Text.ToString()+" </b> </body></html>";
m.IsBodyHtml = true;
}
string frm = txtemailid.Text;
m.From = new MailAddress(frm);
m.CC.Add(new MailAddress("[email protected]"));
m.To.Add(new MailAddress("[email protected]"));
m.Priority = MailPriority.High;
SmtpClient sm = new SmtpClient();
sm.DeliveryMethod = SmtpDeliveryMethod.Network;
sm.Send(m);
}