Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: ASP
Posted by: Mario Lopes
Added: Aug 20, 2019 5:53 PM
Modified: Aug 20, 2019 5:57 PM
Views: 4
Tags: email
  1.  MailMessage Msg = new MailMessage();
  2.             Msg.From = new MailAddress("geral@seusite.com");
  3.             Msg.To.Add("geral@seusite.com");
  4.             StreamReader reader = new StreamReader(Server.MapPath("modeloemailcompra.html"));
  5.             string readFile = reader.ReadToEnd();
  6.             string StrContent = "";
  7.             StrContent = readFile;
  8.          
  9.             Msg.Subject = "Cheirabem - ca vai um teste";
  10.             Msg.Body = StrContent.ToString();
  11.             Msg.IsBodyHtml = true;
  12.             // your remote SMTP server IP.
  13.             SmtpClient smtp = new SmtpClient("mail.seusite.com");
  14.             smtp.Credentials = new NetworkCredential("site", "passe");
  15.             smtp.Send(Msg);