В моем веб-приложении, когда пользователь отправляет любые комментарии о сайте, сообщение придет на мою почту (т. Е. [email protected]). Я работаю отлично до сих пор, но когда я нажимаю на это, чтобы кто-либо (форвардный вариант в [email protected]), он отображается с тегами <html><body>
. Как я могу это решить.отправка mail in 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);
}