using System.Net.Mail;
SmtpClient emailClient = new SmtpClient("smtp.gmail.com", 587);
System.Net.NetworkCredential cred = new System.Net.NetworkCredential("yourMailAddress", "password");
emailClient.Credentials = cred;
MailMessage message = new MailMessage(txtFrom.Text, txtTo.Text, txtSubject.Text, txtMessage.Text);
message.IsBodyHtml = true;
message.Priority = MailPriority.High;
emailClient.EnableSsl = true;
emailClient.Send(message);
0 comments:
Post a Comment