Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static bool SendMail(string userMail, string subject, string body, bool isHtml = false)
- {
- try
- {
- System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
- mail.IsBodyHtml = isHtml;
- mail.From = new System.Net.Mail.MailAddress("Geolab@gmail.com");
- mail.To.Add(userMail);
- mail.Subject = subject;
- mail.Body = body;
- System.Net.Mail.SmtpClient SmtpServer = new System.Net.Mail.SmtpClient("smtp.mandrillapp.com");
- SmtpServer.Port = 587;
- SmtpServer.Credentials = new System.Net.NetworkCredential("geolab.mvc@gmail.com", "IIJQTqUopIBbu0kCpRZPsA");
- SmtpServer.EnableSsl = false;
- SmtpServer.Send(mail);
- return true;
- }
- catch
- {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement