EmailClient class
The Email service client.
Constructors
Email |
Initializes a new instance of the EmailClient class. |
Email |
Initializes a new instance of the EmailClient class using an Azure KeyCredential. |
Methods
begin |
Queues an email message to be sent to one or more recipients |
Constructor Details
EmailClient(string, EmailClientOptions)
Initializes a new instance of the EmailClient class.
new EmailClient(connectionString: string, options?: EmailClientOptions)
Parameters
- connectionString
-
string
Connection string to connect to an Azure Communication Service resource. Example: "endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret";
- options
- EmailClientOptions
Optional. Options to configure the HTTP pipeline.
EmailClient(string, KeyCredential | TokenCredential, EmailClientOptions)
Initializes a new instance of the EmailClient class using an Azure KeyCredential.
new EmailClient(endpoint: string, credential: KeyCredential | TokenCredential, options?: EmailClientOptions)
Parameters
- endpoint
-
string
The endpoint of the service (ex: https://contoso.eastus.communications.azure.net
).
- credential
An object that is used to authenticate requests to the service. Use the Azure KeyCredential or @azure/identity
to create a credential.
- options
- EmailClientOptions
Optional. Options to configure the HTTP pipeline.
Method Details
beginSend(EmailMessage, EmailSendOptionalParams)
Queues an email message to be sent to one or more recipients
function beginSend(message: EmailMessage, options?: EmailSendOptionalParams): Promise<PollerLike<PollOperationState<EmailSendResponse>, EmailSendResponse>>
Parameters
- message
- EmailMessage
Message payload for sending an email
- options
- EmailSendOptionalParams
The options parameters.
Returns
Promise<PollerLike<@azure/core-lro.PollOperationState<EmailSendResponse>, EmailSendResponse>>