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 28, 2018 10:12 AM
Views: 4
Tags: asp.net c# email
Código para fazer um envio de email em asp.net
  1. // envio de email
  2.         MailMessage mail = new MailMessage();
  3.         mail.IsBodyHtml = true;
  4.         mail.From = new MailAddress("este@site.com");
  5.         mail.To.Add("para@este.com,"+txtEmail.Text);
  6.         mail.Subject = "site.com  - Compra de Amostra ";
  7.         mail.Body = cabecalho + dadosEnvio + pires + transferencia + fimemail;
  8.         SmtpClient smtp = new SmtpClient("mail.site.com");
  9.         smtp.Credentials = new NetworkCredential("geral@site.com", "passe");
  10.         smtp.Send(mail);