public void mailconfirmarcompra(URegistro MailE) { //mail MailMessage mail = new MailMessage(); SmtpClient SmtpSever = new SmtpClient("smtp.gmail.com"); mail.From = new MailAddress("*****@*****.**", "Compra exitosa"); //correo que envia, diplay name //SmtpSever.Host = "smtp.gmail.com";//servidor gmail mail.Subject = "Compra finalizada"; //asunto mail.Body = "Su compra de membresia ha sido exitosa señor/a" + MailE.Nombre; mail.To.Add(MailE.Correo); //destino del correo //mail.IsBodyHtml = true; //mail.Priority = MailPriority.Normal; //Configuracion del SMTP SmtpSever.Port = 587; SmtpSever.UseDefaultCredentials = false; SmtpSever.Credentials = new System.Net.NetworkCredential("*****@*****.**", "occibana123"); //correo origen, contra* SmtpSever.EnableSsl = true; SmtpSever.Send(mail); //eviar //mail }
public void enviarmail(URegistro MailE) { //mail MailMessage mail = new MailMessage(); SmtpClient SmtpSever = new SmtpClient("smtp.gmail.com", 587); mail.From = new MailAddress("*****@*****.**", "Registro exitoso"); //correo que envia, diplay name //SmtpSever.Host = "smtp.gmail.com";//servidor gmail mail.Subject = "Registro exitoso"; //asunto mail.Body = "Su registro ha sido exitoso, porfavor recuerde que:\nUsuario: " + MailE.Usuario + "\nContraseña: " + MailE.Contrasena; mail.To.Add(MailE.Correo);//destino del correo //mail.IsBodyHtml = true; //mail.Priority = MailPriority.Normal; //Configuracion del SMTP SmtpSever.Port = 587; SmtpSever.UseDefaultCredentials = false; SmtpSever.Credentials = new System.Net.NetworkCredential("*****@*****.**", "occibana123"); //correo origen, contra* SmtpSever.EnableSsl = true; SmtpSever.Send(mail); //eviar //mail }