Unable to send email

cancel
Showing results for 
Search instead for 
Did you mean: 
manav
Active Member II

Unable to send email

Jump to solution

This is my email conf properties in alfresco-global.properties file

mail.host=smtp.gmail.com
mail.port=465
mail.username=***@gmail.com
mail.password=***
mail.protocol=smtps
mail.smtps.starttls.enable=true
mail.smtps.auth=true
mail.smtp.timeout=30000

I am getting this exceptions


2018-02-21 12:46:51,673 ERROR [action.executer.MailActionExecuter] [mailAsyncAction2] Failed to send email to  ramesh.pate1998@gmail.com : org.springframework.mail.MailSendException: Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1;
nested exception is:
java.net.ConnectException: Connection refused: connect. Failed messages: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1;
nested exception is:
java.net.ConnectException: Connection refused: connect; message exceptions (1) are:
Failed message 1: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1;
nested exception is:
java.net.ConnectException: Connection refused: connect
2018-02-21 12:46:51,673 ERROR [action.executer.MailActionExecuter] [mailAsyncAction1] Failed to send email to ramesh.pate1998@gmail.com : org.springframework.mail.MailSendException: Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1;
nested exception is:
java.net.ConnectException: Connection refused: connect. Failed messages: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1;
nested exception is:
java.net.ConnectException: Connection refused: connect; message exceptions (1) are:
Failed message 1: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1;
nested exception is:
java.net.ConnectException: Connection refused: connect
2018-02-21 12:46:51,674 ERROR [action.executer.MailActionExecuter] [mailAsyncAction3] Failed to send email to  ramesh.pate1998@gmail.com : org.springframework.mail.MailSendException: Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1;
nested exception is:
java.net.ConnectException: Connection refused: connect. Failed messages: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1;
nested exception is:
java.net.ConnectException: Connection refused: connect; message exceptions (1) are:
Failed message 1: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1;
nested exception is:
java.net.ConnectException: Connection refused: connect
Exception in thread "mailAsyncAction3" java.lang.ClassCastException: com.sun.proxy.$Proxy322 cannot be cast to org.alfresco.repo.action.executer.LoggingAwareExecuter
at org.alfresco.repo.action.ActionServiceImpl.onLogException(ActionServiceImpl.java:1823)
at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper.run(AsynchronousActionExecutionQueueImpl.java:442)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "mailAsyncAction2" java.lang.ClassCastException: com.sun.proxy.$Proxy322 cannot be cast to org.alfresco.repo.action.executer.LoggingAwareExecuter
at org.alfresco.repo.action.ActionServiceImpl.onLogException(ActionServiceImpl.java:1823)
at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper.run(AsynchronousActionExecutionQueueImpl.java:442)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "mailAsyncAction1" java.lang.ClassCastException: com.sun.proxy.$Proxy322 cannot be cast to org.alfresco.repo.action.executer.LoggingAwareExecuter
at org.alfresco.repo.action.ActionServiceImpl.onLogException(ActionServiceImpl.java:1823)
at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper.run(AsynchronousActionExecutionQueueImpl.java:442)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

1 Solution

Accepted Solutions
alxgomz
Alfresco Employee

Re: Unable to send email

Jump to solution

Hi Manav,

Your properties doesn't seem to be taken into account.

Check that your alfresco-global.properties file is readable to the alfresco process and is in the right location (should be in $CATALINA_HOME/shared/classes).

It may also be because there are some options that have been set in the admin console and overrides the properties in this file. Check your Alfresco admin console.

View solution in original post

3 Replies
alxgomz
Alfresco Employee

Re: Unable to send email

Jump to solution

Hi Manav,

Your properties doesn't seem to be taken into account.

Check that your alfresco-global.properties file is readable to the alfresco process and is in the right location (should be in $CATALINA_HOME/shared/classes).

It may also be because there are some options that have been set in the admin console and overrides the properties in this file. Check your Alfresco admin console.

mehe
Senior Member II

Re: Unable to send email

Jump to solution

just a dumb question: restarted alfresco after config change?

Second: Alfresco Versions prior 3.3 need a change to custom-email-context.xml to use smtps - but I don't think you are using 3.2 or older...

manav
Active Member II

Re: Unable to send email

Jump to solution

@Martin Ehe ,@Alexander. Thank you very much for your replies,
 I just cleaned my maven project and all is working fine.