Following Codes demonstrates how to send an email with SMTP Authentication using ASP.NET 3.5
using System.Net.Mail
MailMessage msgMail = new MailMessage();
MailMessage myMessage = new MailMessage();
myMessage.From = new MailAddress("sender's email","sender`s name and surname");
myMessage.To.Add("recipient's email");
myMessage.Subject = "Subject";
myMessage.IsBodyHtml = true;
myMessage.Body = "Message Body";
SmtpClient mySmtpClient = new SmtpClient();
System.Net.NetworkCredential myCredential = new System.Net.NetworkCredential("email", "password");
mySmtpClient.Host = "your smtp host address";
mySmtpClient.UseDefaultCredentials = false;
mySmtpClient.Credentials = myCredential;
mySmtpClient.ServicePoint.MaxIdleTime = 1;
mySmtpClient.Send(myMessage);
myMessage.Dispose();
Note : You can avoid mySmtpClient.ServicePoint.MaxIdleTime, as it is to force the SmtpClient to send mail immediately with the .Send method.