Expand my Community achievements bar.

Join us in celebrating the outstanding achievement of our AEM Community Member of the Year!

Issues With Send Email AEMaaCS

Avatar

Level 2

Hi everyone,

I have configured the email notification in AEM Cloud, but I am still experiencing a timeout.
The error message is as follows:
"Sending the email to the following server failed: email-smtp.<<name>>.com:465
Couldn't connect to host, port: email-smtp.<<name>>.amazonaws.com, 465; timeout 30000"

* com.day.cq.mailer.DefaultMailService.cfg.json

{
"debug.email": "true",
"smtp.host": "$[env:SMTP_HOST;default=]",
"smtp.password": "$[secret:SMTP_PASSWORD;default=]",
"from.address": "$[env:SMTP_FROM_ADDRESS;default=]",
"smtp.port": "465",
"smtp.ssl": "true",
"smtp.user": "$[env:SMTP_USER;default=]"
}

 ERROR:

com.day.cq.mailer.MailingException: org.apache.commons.mail.EmailException: Sending the email to the following server failed : email-smtp.<<name>>.amazonaws.com:465
at com.day.cq.mailer.impl.DefaultMailService.send(DefaultMailService.java:334) [com.day.cq.cq-mailer:5.15.2]
at com.day.cq.mailer.impl.DefaultMailService.send(DefaultMailService.java:46) [com.day.cq.cq-mailer:5.15.2]
at com.adobe.acs.commons.email.impl.EmailServiceImpl.sendEmail(EmailServiceImpl.java:194) [com.adobe.acs.acs-aem-commons-bundle:5.4.0]
at com.adobe.acs.commons.email.impl.EmailServiceImpl.sendEmail(EmailServiceImpl.java:221) [com.adobe.acs.acs-aem-commons-bundle:5.4.0]
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.mayService(SlingSafeMethodsServlet.java:266) [org.apache.sling.api:2.27.6]
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:342) [org.apache.sling.api:2.27.6]
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:374) [org.apache.sling.api:2.27.6]
at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:544) [org.apache.sling.engine:2.15.18]
 

But in local i sents successfully, and in smpt user i don't set any permission boundary,

Please help any idea with it. Please suggest to me,

Many Thanks

2 Replies

Avatar

Level 9

Hi @dante8888,

I think you will need to add port forwarding, which can be done on AEMaaCS through Advanced Networking: https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/security/configu...

Here is an example from my project:

{
  "portForwards": [
    {
      "name": "smtp.testmail.io",
      "portDest": 2525,
      "portOrig": 30001
    },
    {
      "name": "smtp.testmail.io",
      "portDest": 465,
      "portOrig": 30002
    }
  ]
}

 

Good luck,

Daniel

Avatar

Level 4

As per the documentation we should update the osgi configuration similar to the below one 

{
  "smtp.host": "$[env:AEM_PROXY_HOST;default=proxy.tunnel]",
  "smtp.port": "30587",
  "smtp.user": "$[env:EMAIL_USERNAME;default=apikey]",
  "smtp.password": "$[secret:EMAIL_PASSWORD]",
  "from.address": "noreply@domain.com",
  "smtp.ssl": false,
  "smtp.starttls": true,
  "smtp.requiretls": false,
  "debug.email": true,
  "oauth.flow": false
}

 And the 

 "smtp.port": "30587",

  shoud be passed in port-forwarding