MailAddress fromAddress = new MailAddress("testmail@interwebs.com"); MailAddress toAddress = new MailAddress("domlennonza@gmail.com"); string subject = "Test Subject"; string body = "Test Message"; SmtpClient client = new SmtpClient { Host = "mail.mymailserver.co.za", UseDefaultCredentials = false, Credentials = new NetworkCredential("username", "password") }; using (MailMessage mm = new MailMessage(fromAddress, toAddress)) { mm.Subject = subject; mm.Body = body; client.Send(mm); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)