Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private async void SendMail(Customer c, int listaId)
- {
- var message = new MailMessage();
- var body = "<p>Este mensage de notificación es para informarte que tu lista de bodas con el código: " + listaId + "ha sido creada exitosamente, </p> ";
- message.To.Add(new MailAddress(c.Email)); // replace with valid value
- message.From = new MailAddress("asanchez@workapps.com.co"); // replace with valid value
- message.Subject = "Tu lista en Cachivaches.com ha sido creada exitosamente";
- message.Body = string.Format(body, 2, 2);
- message.IsBodyHtml = true;
- using (var smtp = new SmtpClient())
- {
- var credential = new NetworkCredential
- {
- UserName = "asanchez@workapps.com.co",
- Password = "password"
- };
- smtp.Credentials = credential;
- smtp.Host = "smtp.office365.com";
- smtp.Port = 587;
- smtp.EnableSsl = true;
- try
- {
- await smtp.SendMailAsync(message);
- }
- catch
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement