
30/08/2007, 06:36
|
 | | | Fecha de Ingreso: marzo-2006 Ubicación: Uruguay
Mensajes: 493
Antigüedad: 19 años, 1 mes Puntos: 1 | |
Re: enviar emailes con asp.net
Código:
System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("relay-hosting.xxxxxxxxxxx.net",25);
System.Net.Mail.MailAddress from = new System.Net.Mail.MailAddress("[email protected]");
System.Net.Mail.MailAddress to = new System.Net.Mail.MailAddress("[email protected]");
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage(from, to);
msg.Subject = "Mail desde la pagina";
msg.Body = "De:" + txtEmail.Text + ";" + System.Environment.NewLine;
msg.Body += txtMensaje.Text;
msg.BodyEncoding = System.Text.Encoding.UTF8;
System.Net.NetworkCredential nc = new System.Net.NetworkCredential(System.Configuration.ConfigurationManager.AppSettings["mailUser"], System.Configuration.ConfigurationManager.AppSettings["mailPwd"]);
client.Credentials = nc;
client.Send(msg);
|