SmtpClient.SendMailAsync Method (MailMessage)

.NET Framework (current version)
 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Sends the specified message to an SMTP server for delivery as an asynchronous operation.

Namespace:   System.Net.Mail
Assembly:  System (in System.dll)

[<HostProtectionAttribute(SecurityAction.LinkDemand, ExternalThreading = true)>]
member SendMailAsync : 
        message:MailMessage -> Task

Parameters

message
Type: System.Net.Mail.MailMessage

A MailMessage that contains the message to send.

Return Value

Type: System.Threading.Tasks.Task

Returns Task.

The task object representing the asynchronous operation.

Exception Condition
ArgumentNullException

message is null.

This operation will not block. The returned Task> object will complete once the message has been sent.

.NET Framework
Available since 4.5
Return to top
Show: