Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
page_type languages products
sample
javascript
nodejs
azure
azure-communication-services

Email Sample

Overview

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.

Prerequisites

Note: We can send an email from our own verified domain also Add custom verified domains to Email Communication Service.

Code structure

  • ./send-email/package.json: Package file
  • ./send-email/send-email.js: Entry point into the email sample

Before running the sample for the first time

  1. 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.
  2. git clone https://github.com/Azure-Samples/communication-services-javascript-quickstarts.git

Locally configuring the application

  1. 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.

Local run

- `npm install` from the root directory.
- `npm start` from the root directory.

❤️ Feedback

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.