【发布时间】:2019-02-14 18:56:14
【问题描述】:
【问题讨论】:
【问题讨论】:
尝试查看MailMessage 类。您在该页面上有一个示例。
MailAddress from = new MailAddress("ben@contoso.com", "Ben Miller");
MailAddress to = new MailAddress("jane@contoso.com", "Jane Clayton");
MailMessage message = new MailMessage(from, to);
message.Subject = "Using the SmtpClient class.";
message.Body = @"Using this feature, you can send an e-mail message from an application very easily.";
SmtpClient client = new SmtpClient();
client.Send(message);
请注意,没有参数的 SmtpClient 从 app.config / web.config 获取配置。更多配置信息可以查看mailSettings section
【讨论】:
SmtpClient 而不是 SendGrid SDK。
SmtpClient,这是重复的……