Karl Gjertsen

Architect, Developer, Speaker, Bad Golfer,
Raygun brand ambassador and creator of Infiniforms

Monthly Archives: October 2014

Sending an email with Mail4Net

Mail4Net is a .NET library for creating, managing and sending emails. Sending an email Typically, you create a MailMessage class, populate it and then send it to a SMTP server, using Microsoft’s System.Net.Mail.SmtpClient class: private void SendEmail() { // Create mail message. var message = new System.Net.Mail.MailMessage(); message.To.Add(“someone@mydomain.com”); message.From = new MailAddress(“me@mydomain.com”); message.Subject = “Hello World”; message.Body = “Here is…