com.day.cq.mailer.MailingException: Invalid mail service configuration. | Community
Skip to main content
Level 3
January 7, 2019
Solved

com.day.cq.mailer.MailingException: Invalid mail service configuration.

  • January 7, 2019
  • 3 replies
  • 12760 views

Hi guys,

I'm facing mail configuration issue in AEM 6.4.2 only in TEST(no sample content)  but not in sandbox(with sample content).

I have checked configurations for both which are same and bundle are also mostly same.nly diff i can see is in TEST packmgr

and in sandbox packmgr

Please help me to resolve this issue.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by aanchal-sikka

Since, you have visually validated the configs from OSGi console, existence of sample packages should not cause an issue.

Here are the few items you can try:

- Verify that the port is open on server using telnet <smtp_host> <smtp_port>

- Refresh/Restart "com.day.cq.cq-mailer" bundle

 

3 replies

smacdonald2008
Level 10
January 7, 2019

Are you trying to send email from an AEM Service. If so - you should use the MessageGatewayService API. It works fine. See this example that uses this API to send email messages. There is also a video...

Adobe Experience Manager Help | Creating an Adobe Experience Manager 6.4 custom workflow step that uses the MessageGatew…

See if this code works for you.

Level 3
January 8, 2019

Hi Smacdonald,

I'm trying to send email from AEM service and I'm using MessageGatewayService API to send emails.

Here is my code

Please let me know do we need any dependency related to core.wcm.components.all.

Thanks,

Kiran

Gaurav-Behl
Level 10
January 7, 2019

It seems that you are using a custom smtp host to send emails. Check if that host is available ? Telnet on port 25 on that box itself-

telnet <hostname> 25

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.

Level 3
January 8, 2019

Hi Gaurav,

I'm using custom smtp host to send emails and which is available.

Configuration for sandbox and test are same.Below are the screenshots.

test

Let me know if i need to do any changes.

Thanks,

Kiran

Level 3
January 10, 2019

Could you try with a different smtp-host and from-address?

Are these both servers (the one which works fine and other which doesn't work) setup on same box? Is it win/linux? Can you do telnet on these boxes to check if smtp-host and the host of your from-address are available?


Hi Gaurav,

We have access for only this host.In same box we have AEM 6.3 and 6.4 and In 6.3 it is working fine.Those are in linux machine.

I have done ping command to host  and those are available.

Please let me know further

Thanks,

Kiran

aanchal-sikka
Community Advisor
aanchal-sikkaCommunity AdvisorAccepted solution
Community Advisor
December 5, 2023

Since, you have visually validated the configs from OSGi console, existence of sample packages should not cause an issue.

Here are the few items you can try:

- Verify that the port is open on server using telnet <smtp_host> <smtp_port>

- Refresh/Restart "com.day.cq.cq-mailer" bundle

 

Aanchal Sikka