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.
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
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.
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.
Adobe Experience Manager Help | Creating custom AEM workflow steps that send email messages
There was some issue with our mailing server, it has been resolved by our hosting partner.
Thanks for all our help!
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.