Ja tenho um método em meu controller que envia email. Agora precisa contemplar anexo (todos os tipos de anexo, 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();