SmtpClient.CreateAsync

SmtpClient.CreateAsync method

Creates a new instance of the SmtpClient class

public static Task<IAsyncSmtpClient> CreateAsync(string host, string username, 
    IAsyncTokenProvider asyncTokenProvider, int port = 25, 
    SecurityOptions securityOptions = SecurityOptions.Auto, 
    CancellationToken cancellationToken = default)
ParameterTypeDescription
hostStringThe host name
portStringThe port number
usernameIAsyncTokenProviderThe user name
asyncTokenProviderInt32The access token provider.
securityOptionsSecurityOptionsSecurity mode for a mail client
cancellationTokenCancellationTokenThe cancellation token.

See Also