0
I already have a method in my controller that sends email. Now you need to contemplate attachments (all attachment types, jpg, pdf, doc...);
string strPara = Request.Form["email"];
string strDe = "[email protected]";
string strTexto = "teste";
SmtpClient client = new SmtpClient();
client.Port = 25;
client.Host = "exchange.local";
client.EnableSsl = true;
client.Timeout = 10000;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential("gustavo.r", "123456");
MailMessage mm = new MailMessage(strDe, strPara, "teste", strTexto);
mm.BodyEncoding = UTF8Encoding.UTF8;
mm.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
client.Send(mm);
return View();
how caught the html inputfile attachment?
– Danielle Arruda torres