AEM as a Cloud Service SMTP email not working or can’t be configured
AEM as a Cloud Service doesn’t include an SMTP server and can’t connect to internal or AMS SMTP hosts, so email fails when customers expect a built-in server or try to use a corporate or legacy relay. All outbound email must go through a customer-provided public, authenticated SMTP provider routed through Advanced Networking, and Sandbox environments don’t support Advanced Networking, so SMTP can’t function there. Selecting an external SMTP provider, configuring Advanced Networking port forwarding, and adding the mail service OSGi configuration enables email delivery from Stage and Production environments.
Description description
Environments:
- Adobe Experience Manager as a Cloud Service (AEMaaCS)
- AEM Assets Essentials
- Cloud Manager (Advanced Networking)
- Stage and Production environments (Sandbox and RDE don’t support Advanced Networking)
Issue/Symptoms:
- Email works on localhost but fails on AEM Cloud, with 500 errors when the code is deployed to Author or Publish.
- SMTP configuration can’t be completed because the customer expected Adobe to provide an SMTP server.
- Email can’t be sent on Sandbox environments because Advanced Networking isn’t supported there.
- Attempts to use an internal-only SMTP server fail because AEMaaCS requires a public authenticated SMTP endpoint.
Root cause:
AEM as a Cloud Service doesn’t provide an SMTP server and can’t connect to internal SMTP hosts. All outbound email must use a customer-provided public external SMTP provider routed through Advanced Networking. Sandbox environments don’t support Advanced Networking, so SMTP isn’t possible there. Attempts to use AMS-provided no-SLA SMTP servers fail because they aren’t reachable from the AEMaaCS Kubernetes environment.
How to confirm
- Determine whether the environment supports SMTP. Identify whether the environment is Sandbox, RDE, Stage, or Production. SMTP isn’t supported on Sandbox or RDE, so testing has to happen in a Stage or Production-level environment.
- Confirm the intended SMTP endpoint is external and public. AEMaaCS can’t reach internal or AMS SMTP hosts, so an internal-only server won’t work regardless of configuration.
Resolution resolution
Follow these steps to resolve the issue:
-
Select and prepare an external SMTP provider. Choose a public, authenticated SMTP provider and obtain its host, port, username, and password. These credentials come from your email provider — Adobe doesn’t supply SMTP credentials.
-
Configure Advanced Networking in Cloud Manager. Create
portForwardswithportOrigset in the 30000–30999 range andportDestset to 465 or 587 depending on your SMTP provider. Confirm the Cloud Manager pipeline JSON includes aportForwardsblock. -
Add the mail service OSGi configuration to your repository. Create
ui.config/src/jcr_root/apps/<project>/osgiconfig/config/com.day.cq.mailer.DefaultMailService.cfg.jsonwith these values:smtp.host= $[env:AEM_PROXY_HOST;default=proxy.tunnel]smtp.port= theportOrigvalue from the previous step (for example: 30465 or 30587)smtp.ssl= true when using port 465, or false when using port 587
-
Redeploy via Cloud Manager. Run a full deployment pipeline, then open
/system/console/configMgr(read-only but visible on AEMaaCS) and confirmcom.day.cq.mailer.DefaultMailServicereflects the configured values. -
Verify SMTP connectivity. Trigger an AEM workflow email or send an email via a custom servlet, then check your SMTP provider logs for an authenticated connection. If delivery is blocked, check whether the provider is rejecting it due to DKIM/DMARC, which is handled at the SMTP provider level rather than in AEM.
Validation
- Confirm an email sent from AEM appears in the SMTP provider’s dashboard logs.
- Confirm the Day CQ Mail Service shows
smtp.host= proxy.tunnel and ansmtp.portin the 30000–30999 range in the OSGi console. - Confirm the AEM
error.logshows no SMTP connection errors.