How to Send Emails Using SMTP Relay with Azure Communication Services

How to Send Emails Using SMTP Relay with Azure Communication Services. This tutorial covers setting up Azure Communication Services to send emails via SMTP relay, perfect for developers, IT admins, and cloud technicians. A step-by-step guide for developers and IT admins to configure secure email delivery from apps, printers, and IoT devices.

Scroll Down for Video Link

More Posts: Technical Blogs

Why Use Azure SMTP Relay?

  • Avoid IP blacklisting by relaying through Microsoft’s trusted servers
  • No mail server maintenance – fully cloud-based solution
  • Enterprise-grade security with TLS encryption and authentication
  • Scalable pricing – pay only for emails sent

Use Cases

  • Sending emails from applications (CRM, ERP)
  • Configuring “scan to email” on printers
  • Sending emails from IoT devices or backend systems

Benefits of Azure SMTP Relay

  • Avoids IP blacklisting by relaying through trusted SMTP server
  • Secure and authenticated email delivery
  • No need to host your own mail server

Prerequisites for Azure SMTP Relay

  1. Azure subscription (Pay-As-You-Go works)
  2. Communication Service resource in Azure
  3. Verified domain (or subdomain) for email
  4. SMTP client/app/code to send emails
  5. Open outbound ports (587 recommended, or 25)
I

1. Create Email Communication Service in Azure

  • Search for “Email Communication Services” in Azure portal
  • Create new resource:
    • Resource group: “Email-SMTP-Relay”
    • Location: Choose nearest region
    • Name: “Email-SMTP-Relay”
    • Data location: Select appropriate region

2. Verify Your Domain for SMTP Relay

  1. Create a subdomain (e.g., newsletters.yourdomain.com)
  2. In Email Communication Service:
    • Add custom domain (newsletters.yourdomain.com)
    • Verify domain by adding TXT record to DNS
    • Configure SPF and DKIM records (TXT and CNAME records)

Important Note: When adding DKIM records for subdomains, append your subdomain to the Azure-provided domain key (e.g., add “.newsletters” to the domain key value).

3. Create Communication Service

  • Search for “Communication Services” in Azure portal
  • Create new resource:
    • Name: “Newsletter-Service”
    • Same resource group as before
    • Same location

4. Connect Domain to Communication Service

  • In Communication Service, go to “Connect your email domains”
  • Select your Email Communication Service resource
  • Select your verified domain

5. Set Up Authentication

  1. Create Azure AD application:
    • In Azure AD > App registrations > New registration
    • Name: “Newsletter-Delivery-App”
    • Accounts in this organization only
    • Register
  2. Create client secret:
    • Go to Certificates & secrets
    • New client secret (e.g., “Delivery-App-Secret”)
    • Copy the secret value (this will be your SMTP password)
  3. Assign role:
    • In Communication Service > Access Control (IAM)
    • Add role assignment: “Communication Email Service Owner”
    • Select your “Newsletter-Delivery-App” as member

6. Create SMTP Usernames

7. Configure Mail From Addresses

Sending Emails

Troubleshooting

  • If emails aren’t sending, check:
    • Outbound port 587/25 is open in firewall
    • Domain verification is complete (may take 15-20 minutes)
    • Newly created sender addresses may take time to activate
    • TLS must be enabled when using port 25

Pricing

  • Based on number of emails sent and their size
  • Example: 1 million 3MB emails ≈ $122/month
  • Use Azure pricing calculator for accurate estimates

This solution provides a reliable, cloud-based SMTP relay service that avoids IP blacklisting issues while providing secure email delivery.

How to Send Emails Using SMTP Relay with Azure Communication Services: Video on Techno Tips Learning


Explore our Literature YouTube Channels:

Hindi Sahitya 1

YouTube Channel Link:

@hindi_sahitya_01

DALL·E 2024 11 04 12.55.23 A stylish and inviting logo for The Literature Lounge YouTube channel. Features an open book with elegant curling pages and a vintage feather quill

YouTube Channel Link:

@The_Literature_Lounge

Designer 40

YouTube Channel Link:

@techno_tips_learning

niteshsinhaofficial e1738723497984

YouTube Channel Link

@nitesh_sinha_official

Leave a Comment

Scroll to Top