grails - Email not sent via Gmail - Username and Password not accepted -


i getting error while trying send email via gmail. here's code, in config.groovy file.

mail.mailmessagebuilder failed send email org.springframework.mail.mailauthenticationexception: authentication failed; nested exception javax.mail.authenticationfailedexception: 535-5.7.8 username , password not accepted. learn more @ 535 5.7.8 http://support.google.com/mail/bin/answer.py?answer=14257 ca4sm3178528pbd.79 - gsmtp          @ grails.plugin.mail.mailmessagebuilder$_sendmessage_closure1.docall(mailmessagebuilder.groovy:112)         @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145)         @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615)         @ java.lang.thread.run(thread.java:745) caused by: javax.mail.authenticationfailedexception: 535-5.7.8 username , password not accepted. learn more @ 535 5.7.8 http://support.google.com/mail/bin/answer.py?answer=14257 ca4sm3178528pbd.79 - gsmtp          @ com.sun.mail.smtp.smtptransport$authenticator.authenticate(smtptransport.java:843)         @ com.sun.mail.smtp.smtptransport.authenticate(smtptransport.java:765)         @ com.sun.mail.smtp.smtptransport.protocolconnect(smtptransport.java:687)         @ javax.mail.service.connect(service.java:345)         ... 4 more 

code:

grails {     mail {       host = "smtp.gmail.com"       port = 465       username = "yomama@gmail.com"       password = "ttyuioiuy78"       props = ["mail.smtp.auth":"true",                "mail.smtp.socketfactory.port":"465",                "mail.smtp.socketfactory.class":"javax.net.ssl.sslsocketfactory",                "mail.smtp.socketfactory.fallback":"false"]     }  } 

i tried suggested solutions link provided.

i signed in , changed password. unlocked captcha displayunlockcaptcha clicked on allow less secure apps access app

i followed these steps , i'm not getting errors , working fine..

  1. install mail plugin grails using command

    grails install-plugin mail 1.0.7 
  2. open config.groovy , append these lines

     grails {          mail {               host = "smtp.gmail.com"               port = 465               username = "your gmail id"               password = "your password"               props = ["mail.smtp.auth":"true",               "mail.smtp.socketfactory.port":"465",               "mail.smtp.socketfactory.class":"javax.net.ssl.sslsocketfactory",               "mail.smtp.socketfactory.fallback":"false"]               }        } 
  3. in action want send mail use code

    sendmail {        "recepient address"        subject "hello fred"        body 'how you?'        } 
  4. compile app using

    grails compile 
  5. run app


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -