page_type | languages | products | ||||
---|---|---|---|---|---|---|
sample |
|
|
This is a sample email application to show how we can use the @azure/communication-email
package to build an email experience.
This sample sends an email to the selected recipients of any domain using an Email Communication Services resource.
This is a console application built using Node.js 14.
Additional documentation for this sample can be found on Microsoft Docs.
- Visual Studio Code (Stable Build).
- Node.js (~14).
- Create an Azure account with an active subscription. For details, see Create an account for free.
- Create an Azure Communication Services resource. For details, see Create an Azure Communication Resource. You'll need to record your resource connection string for this quickstart.
- Create an Azure Email Communication Services resource to start sending emails.
Note: We can send an email from our own verified domain also Add custom verified domains to Email Communication Service.
- ./send-email/package.json: Package file
- ./send-email/send-email.js: Entry point into the email sample
- Open an instance of PowerShell, Windows Terminal, Command Prompt or equivalent program and navigate to the directory that you'd like to clone the sample to.
git clone https://github.com/Azure-Samples/communication-services-javascript-quickstarts.git
- Open the send-email.js file to configure the following settings:
connectionstring
: Replace<ACS_CONNECTION_STRING>
with the connection string found within the Azure Communication Service resource.sender
: Replace<SENDER_EMAIL>
with the sender email obtained from Azure Communication Service.recipient
: Replace<RECIPIENT_EMAIL>
with the recipient email.emailContent
: Either use PlainText or Html to set the email content.
- `npm install` from the root directory.
- `npm start` from the root directory.
We appreciate your feedback and energy in helping us improve our services. Please let us know if you are satisfied with ACS through this survey.