public void Send(string to, string message)
{
MailMessage alert = new MailMessage("something@example.com", to);
alert.Subject = "Communication!";
alert.Body = message;
NetworkCredential credentials = new NetworkCredential("something@example.com",
"letmein");
SmtpClient emailSender = new SmtpClient();
emailSender.Host = "smtp.example.com";
emailSender.UseDefaultCredentials = false;
emailSender.Credentials = credentials;
emailSender.Send(alert);
}
No comments:
Post a Comment