【发布时间】:2013-09-08 01:07:18
【问题描述】:
system.net.mail.smtpclient 有两种我很困惑的方法。
1 . SendAsync(MailMessage, Object)
Sends the specified e-mail message to an SMTP server for delivery. This method does not block the calling thread and allows the caller to pass an object to the method that is invoked when the operation completes.-MSDN
2 。 SendMailAsync(MailMessage)
Sends the specified message to an SMTP server for delivery as an asynchronous operation.-MSDN
请注意,两个方法的名称不同,因此它不是重载。这里到底有什么区别?
我正在寻找非常明确的答案,因为 MSDN 对这两种方法的描述非常模棱两可(至少对我来说是这样)。
【问题讨论】:
-
SendMailAsync包装SendAsync以使用新的async功能。
标签: c# asp.net email asynchronous