SmtpClient smtpClient = new SmtpClient(); NetworkCredential smtpCredentials = new NetworkCredential("email from","password"); MailMessage message = new MailMessage(); MailAddress fromAddress = new MailAddress("email from"); MailAddress toAddress = new MailAddress("email to"); smtpClient.Host = "smpt host address"; smtpClient.Port = your_port; smtpClient.EnableSsl = true; smtpClient.UseDefaultCredentials = false; smtpClient.Credentials = smtpCredentials; smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network; smtpClient.Timeout = 20000; message.From = fromAddress; message.To.Add(toAddress); message.IsBodyHtml = false; message.Subject = "example"; message.Body = "example"; smtpClient.Send(message);