AnsweredAssumed Answered

GMail and mail.sendmessage

Question asked by borzoi on May 23, 2015
Is mail.sendmessage able and operate with GMail?
I've set the following in alfresco-global.properties:

mail.host=smtp.gmail.com
mail.port=465
mail.username=myusername@gmail.com
mail.password=mypassword
mail.protocol=smtps
mail.smtps.starttls.enable=true
mail.smtp.auth=true
mail.testmessage.send=true
mail.testmessage.to=my.email@my.domain.it
mail.testmessage.subject=Alfresco starte
mail.testmessage.text=Alfresco actually functioning.
notification.email.siteinvite=true

If I don't comment four mail.testmessage.* properties, I got the following error in Alfresco log:

[org.alfresco.repo.action.executer.MailActionExecuter] [localhost-startStop-1] Failed to send email to my.email@my.domain.it : org.springframework.mail.MailAuthenticationException: Authentication failed; nested exception is javax.mail.AuthenticationFailedException: 534-5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbtLH
534-5.7.14 TOIRzFjRonT8crkjvsHeZ_XPDsCcq2pucPkmbr8NldSuhoIWJ9Mk-cZ9idmHC9GH4rkBfv
534-5.7.14 s5okJbO-xu2kYF82qFH4XxmENRhOk7OjyYEnGc7WDde7wQlTdBmpdW5kSiox3_MsSOC6Qh
534-5.7.14 QMEISqgX3u5w4OdKc7FpvwuGF9J3lCo2U-kH2Biz8NB1HR8LLCnByEoOA27zCjJ1BtzTTl
534-5.7.14 aTeLouNGmZd3IsUsVjhMv080r-Cs> Please log in via your web browser and
534-5.7.14 then try again.
534-5.7.14 Learn more at
534 5.7.14 https://support.google.com/mail/bin/answer.py?answer=78754 pz6sm1801719wjc.43 - gsmtp

WARN  [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [localhost-startStop-1] Startup of 'email' subsystem, ID: [email, outbound] failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mail' defined in URL [jar:file:/C:/Alfresco/tomcat/webapps/alfresco/WEB-INF/lib/alfresco-repository-5.0.d.jar!/alfresco/subsystems/email/OutboundSMTP/outboundSMTP-context.xml]: Invocation of init method failed; nested exception is org.alfresco.error.AlfrescoRuntimeException: 04220000 Failed to send email to:my.email@my.domain.it

and, I'm also unable and log to Alfresco Share.
Any way to solve?

Outcomes