using System; using System.Net; using System.Net.Mail;
class MainClass { public static void Main(string[] args) {
SmtpClient client = new SmtpClient("mail.somecompany.com", 25);
client.Credentials = new NetworkCredential("[email protected]", "password"); using (MailMessage msg = new MailMessage()) {
msg.From = new MailAddress("[email protected]");
msg.Subject = "Greetings";
msg.Body = "This is a message.";