Share via

Email Sample

This sample sends an email to the selected recipients of any domain using an Email Communication Services resource.

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

  • ./SendEmail/Program.cs: Entry point for sending email.

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-dotnet-quickstarts.git

Locally configuring the application

  1. Navigate to the SendEmail folder and open the SendEmail.sln solution in Visual Studio.
  2. Open the program.cs file to configure the following settings:
  • connectionString: Replace <ACS_CONNECTION_STRING> with Azure Communication Service resource's connection string.
  • sender: Replace <SENDER_EMAIL> with the sender email obtained from Azure Communication Service.
  • recipient: Replace <RECIPIENT_EMAIL> with the recipient email.
  1. Run SendEmail project.

❤️ 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.