MessageGateway is
Hi
I am created an email servlet in AEM and it works fine when I tested it on my local 4502,
but when I test this servlet on company DEV environment, the messageGateway is always null
MessageGateway<HtmlEmail> messageGateway = messageGatewayService.getGateway(HtmlEmail.class);Here's my code:
@8220494(service = Servlet.class,
property = {
"sling.servlet.methods=" + "GET",
"sling.servlet.paths =" + "/bin/test/email-content-report"})
public class ContentReportServlet extends SlingAllMethodsServlet {
@3214626
MessageGatewayService messageGatewayService;
@9944223
protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) {
try {
MessageGateway<HtmlEmail> messageGateway = messageGatewayService.getGateway(HtmlEmail.class);
if(messageGateway != null) {
HtmlEmail email = new HtmlEmail();
email.setCharset("utf-8");
email.addTo(recipientemail);
email.setFrom("noreply@test.ca");
email.setSubject("Email Testing");
email.setHostName("mailgateway.uk.fid-intl.com");
email.setSmtpPort(587);
email.setSSLOnConnect(false);
email.setHtmlMsg("Test message");
ByteArrayDataSource dataSource = new ByteArrayDataSource(byteStream.toByteArray(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
email.attach(dataSource, "filename.xlsx", "ContentReport", HtmlEmail.ATTACHMENTS);
messageGateway.send(email);
}
} catch (Exception e) {
log.error("Error occurred while sending report by email: {}", e.getMessage(), e);
}
}
}I found a few old posts with the same issue saying that I need to change the day cq mail service, I tried that but still doesn't work
here's the day cq mail service on my local

Here's the day cq mail service for the dev environment

Please advise.
Thank you