// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. /** * @summary Sends an email with a single recipient */ import { EmailClient } from "@azure/communication-email"; // Load the .env file (you will need to set these environment variables) import * as dotenv from "dotenv"; dotenv.config(); const connectionString = process.env["COMMUNICATION_CONNECTION_STRING"] || ""; const senderAddress = process.env["SENDER_ADDRESS"] || ""; const recipientAddress = process.env["RECIPIENT_ADDRESS"] || ""; const sendSingleEmail = async () => { // Create the Email Client const emailClient = new EmailClient(connectionString); // Create the Email Message to be sent const message = { senderAddress: senderAddress, content: { subject: "This is the subject", plainText: "This is the body", html: "

# This is the body