Skip to content
Discussion options

You must be logged in to vote
using (MailMessage mail = new MailMessage("james03817@gmail.com", email))
{
  mail.Subject = subject;
  mail.Body = emailBody;
  mail.IsBodyHtml = true;

  SmtpClient smtp = new SmtpClient();
  smtp.UseDefaultCredentials = false;
  smtp.Host = "smtp.gmail.com";
  smtp.Port = 587;
  smtp.EnableSsl = true;

  smtp.Credentials = new NetworkCredential("xxx@gmail.com", "xxx");
  smtp.Send(mail);
}

Replies: 1 comment

Comment options

v08nike
Oct 8, 2022
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by v08nike
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant