Dans mon application Web, lorsque l'utilisateur envoie des commentaires sur le site, le message est envoyé à mon courrier électronique (par exemple, [email protected]). Ya ça fonctionne bien jusqu'à maintenant, mais quand je clique sur le transmettre à n'importe qui (option de transfert sur [email protected]), il est affiché avec <html><body>
tags. Comment puis-je resoudre ceci.envoyer un mail dans 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);
}