Skip to content

Instantly share code, notes, and snippets.

@robertgreiner
Created February 25, 2010 18:57
Show Gist options
  • Save robertgreiner/314906 to your computer and use it in GitHub Desktop.
Save robertgreiner/314906 to your computer and use it in GitHub Desktop.
class MailManager {
public void send(String subject, String body) {
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.To.Add("name@domain.com");
message.Subject = subject;
message.From = new System.Net.Mail.MailAddress("name@domain.com");
message.Body = body;
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient();
smtp.Host = "host";
smtp.Port = 25;
smtp.Send(message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment