试试看MailMessage课程。您在该页面上有一个示例。
MailAddress from = new MailAddress("[email protected]", "Ben Miller");
MailAddress to = new MailAddress("[email protected]", "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);
请注意,没有params的SmtpClient从app.config / web.config获取配置。您可以查看mailSettings section以获取更多配置信息