Send mail with Play Framework using Google Apps

195 views
Skip to first unread message

Lasse Jul-Larsen

unread,
Jun 17, 2011, 11:14:52 AM6/17/11
to play-framework
Hi, don't know if this is the right place to post it, but hope someone
can help.

I'm trying to set up an app which sends emails to users who signs up.
I want to use my Google Apps account which i have connected to my
domain to send the emails through Google SMTP-server.

I have had successful attempts if i use my busi...@gmail.com account,
but i get trouble when i try to authenticate with my
ad...@business.com account (which is set up with Google Apps, can use
this username to log onto gmail).

This is my mail configuration:

# WORKING
mail.smtp.host=smtp.gmail.com
mail.smtp.user=busi...@gmail.com
mail.smtp.pass=password
mail.smtp.channel=ssl
mail.smtp.port=465
mail.debug=true

# NOT WORKING
mail.smtp.host=smtp.gmail.com
mail.smtp.user=ad...@business.com
mail.smtp.pass=password
mail.smtp.channel=ssl
mail.smtp.port=465
mail.debug=true


My error message:

Mail error
A mail error occured : Error while sending email

play.exceptions.MailException: Error while sending email
at play.libs.Mail$2.call(Mail.java:181)
at play.libs.Mail$2.call(Mail.java:173)
at java.util.concurrent.FutureTask
$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.commons.mail.EmailException: Sending the email
to the following server failed : smtp.gmail.com:25
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:
1242)
at org.apache.commons.mail.Email.send(Email.java:1267)
at play.libs.Mail$2.call(Mail.java:178)
... 6 more
Caused by: javax.mail.AuthenticationFailedException: 535-5.7.1
Username and Password not accepted. Learn more at
535 5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257
n3sm2098755bka.16

at com.sun.mail.smtp.SMTPTransport
$Authenticator.authenticate(SMTPTransport.java:648)
at
com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:
583)
at javax.mail.Service.connect(Service.java:313)
at javax.mail.Service.connect(Service.java:172)
at javax.mail.Service.connect(Service.java:121)
at javax.mail.Transport.send0(Transport.java:190)
at javax.mail.Transport.send(Transport.java:120)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:
1232)
... 8 more
~ ...

Hope someone has the answer :)

Pascal Voitot Dev

unread,
Jun 18, 2011, 4:25:52 AM6/18/11
to play-fr...@googlegroups.com
I don't have the solution but you should ask to google people because authentication on a SMTP google server with an owned domain looks like a google feature ...

sorry
Pascal


--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.


Rakesh Waghela

unread,
Jun 18, 2011, 4:29:41 AM6/18/11
to play-fr...@googlegroups.com
checkout with
port
="587"
Reply all
Reply to author
Forward
0 new messages