当用户填写在线表格时,我在 c# .NET 中使用以下内容发送电子邮件。我想知道我所拥有的是否需要线程。
MailAddress From = new MailAddress("xyz@qinc.com");
MailAddress To = new MailAddress(toemail);
MailMessage alert = new MailMessage(From, To);
alert.Subject = "Registration for " + name;
alert.Body = bodyText;
alert.IsBodyHtml = true;
NetworkCredential creds = new NetworkCredential("bot@qinc.com", "Xfdfdfd");
SmtpClient client = new SmtpClient("smtp.gmail.com");
client.EnableSsl = true;
client.Credentials = creds;
client.Send(alert);
提前致谢