We are trying to send email from an AEM Service using MessageGatewayService API. The weird part is, it is working on all lower environment and including in our local aem instance but it is not working only in Live servers. We verified the below things
com.day.cq.mailer.MailingException: Invalid mail service configuration.
Is there any additional configuration to verify?
The error says invalid mail service configuration which means either hostname, user/pass, etc. is not configured or read properly. If possible, check line #270 of DefaultMailService.java and that's the rootcause. Compare the configurations of your sandbox vs this server.
And do a “Refresh Package Import” of "com.day.cq.cq-mailer" bundle and see if that helps.