Highlighted

MessageGateway is null sometimes

poo21488

30-01-2018

Referring to the older thread

Mail MessageGateway is null

I'm facing a similar problem where the emails are sent successfully sometimes and sometimes not.

If I check the logs, when emails are not sent I see this in my error.log

com.day.cq.wcm.foundation.forms.impl.MailServlet The mail service is currently not available! Unable to send form mail.

This translates to me that the object for class com.day.cq.mailer.MailService was null. Please advice.

Replies

Highlighted

smacdonald2008

30-01-2018

Another way you can go about this is to write app logic in email API to connect to the SMTP server directly - I have never heard of issues when doing so -- Scott's Digital Community: Creating custom CQ email services

Highlighted

poo21488

30-01-2018

Thanks Mac!

My team looks after almost 20 websites (with different code bases) and each of them have minimum one contact us form.

Implementing the email api logic to connect to SMTP server directly won't work for me right now.

Please suggest if there are any other methods to troubleshoot this problem.

Highlighted

kautuk_sahni

Community Manager

31-01-2018

Can you check the robustness of the mail server in use? Error clearly state mail server was not available.

May be you can debug it by writing a script(Perl, python,power-shell,shell etc) mail server.

If this is not a problem with mail server then do check this on the fresh AEM instance.

If problem still persist do create a support ticket for this. I read similar issue earlier as well.

Reference article:- Adobe Experience Manager Help | Creating Adobe Experience Manager HTL Components that send Email mes...

// Read the configuration and modify your code accordingly to fit it into your exiting case of multiple sites.

OR

Adobe Experience Manager Help | Creating custom AEM workflow steps that send email messages

-Kautuk

Highlighted

poo21488

15-02-2018

There was some issue with our mailing server, it has been resolved by our hosting partner.

Thanks for all our help!

Highlighted

smacdonald2008

15-02-2018

that for posting what happened - typically when somethign is wrong with the MessageServiceGate way - there could be an issue with the email server. that is why i asked you to test via Java logic. Anyhow - i am glad you got it working.