Expand my Community achievements bar.

SOLVED

Day CQ Mail Service with Gmail as SMTP

Avatar

Level 5

Hi All,

 

I am trying to send email in AEM via CQ Mail Service and using below blog -

https://techrevel.blog/2023/06/12/utilizing-gmail-smtp-for-cost-free-email-transmission-from-aem/

 

But getting below errors -

1. Gmail - Port 587

EmailException: Sending the email to the following server failed : smtp.gmail.com:587

EmailException: Sending the email to the following server failed : smtp.gmail.com:587

MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587

SSLException: Unsupported or unrecognized SSL message

 

2. Gmail - Port 465

EmailException: Sending the email to the following server failed : smtp.gmail.com:465

EmailException: Sending the email to the following server failed : smtp.gmail.com:465

AuthenticationFailedException: 535-5.7.8 Username and Password not accepted.

https://support.google.com/mail/?p=BadCredentials

 

3. Yahoo - Port 465

EmailException: Sending the email to the following server failed : smtp.mail.yahoo.com:465

SMTPSendFailedException: 550 Request failed; Mailbox unavailable

SMTPSenderFailedException: 550 Request failed; Mailbox unavailable

 

4. Yahoo - Port 587

EmailException: Sending the email to the following server failed : smtp.mail.yahoo.com:587

EmailException: Sending the email to the following server failed : smtp.mail.yahoo.com:587

MessagingException: Could not connect to SMTP host: smtp.mail.yahoo.com, port: 587

SocketException: Connection reset

 

Any help @arunpatidar@EstebanBustamante@Imran__Khan@aanchal-sikka,

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @aem_noob,

 

Looks like authentication problem for Port 465 with Gmail.

For Yahoo, The 550 Response code could be because of any of the reasons listed in the How to Fix Yahoo Mail Error 550 Mailbox Unavailable

 

Can you try using a different SMTP provider? (Send Grid, Brevo, Mail Trap etc.)

I used Brevo for my local development and it works perfectly fine- 

Rohan_Garg_0-1712208130310.png

Hope this helps!

 

Rohan Garg

View solution in original post

6 Replies

Avatar

Community Advisor

Is it aem cloud service or ams/on-prem? In aem cloud service you need to configure proxy port but in ams/on-prem it should be straight forward.

Avatar

Level 2

For gmail-smtp ,you need to use app password, for that two step authentication should be already enabled. Create app password using the link -    https://myaccount.google.com/apppasswords

Avatar

Correct answer by
Community Advisor

Hi @aem_noob,

 

Looks like authentication problem for Port 465 with Gmail.

For Yahoo, The 550 Response code could be because of any of the reasons listed in the How to Fix Yahoo Mail Error 550 Mailbox Unavailable

 

Can you try using a different SMTP provider? (Send Grid, Brevo, Mail Trap etc.)

I used Brevo for my local development and it works perfectly fine- 

Rohan_Garg_0-1712208130310.png

Hope this helps!

 

Rohan Garg

Avatar

Level 5

Its working with 3rd party SMTPs yes
But why would they not work with Gmail and Yahoo any pointers?