Google Groups

Re: [2.0] play framework plugin mailer on heroku


James Ward Jul 28, 2012 1:44 PM
Posted in group: play-framework
It looks like there is something wrong with your auth setup.  I don't think there is anything on Heroku that would prevent this from working.

I've used the Mailer Plugin with the SendGrid add-on and it worked fine.  My config:
smtp.port=587
smtp.ssl=true
smtp.user=${SENDGRID_USERNAME}
smtp.password=${SENDGRID_PASSWORD}

Hope that helps.

-James


On Saturday, July 28, 2012 4:37:22 AM UTC-6, Hugo Alves wrote:
currently i'm using this plugin  https://github.com/typesafehub/play-plugins/tree/master/mailer and haven't had any trouble with it on the localhost. but as soon as i push it to heroku it give me this annoying error:

  Internal server error, for request [POST /mobile/newUser] ->

  play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[EmailException: Sending the email to the following server failed : smtp.gmail.com:587]]
   at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:134) [play_2.9.1-2.0.1.jar:2.0.1]
   at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:115) [play_2.9.1-2.0.1.jar:2.0.1]
   at akka.actor.Actor$class.apply(Actor.scala:311) [akka-actor-2.0.1.jar:2.0.1]
   at play.core.ActionInvoker.apply(Invoker.scala:113) [play_2.9.1-2.0.1.jar:2.0.1]

   at akka.actor.ActorCell.invoke(ActorCell.scala:619) [akka-actor-2.0.1.jar:2.0.1]

   at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:196) [akka-actor-2.0.1.jar:2.0.1]
  Caused by: org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.gmail.com:587
   at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1242) ~[commons-email-1.2.jar:1.2]
   at org.apache.commons.mail.Email.send(Email.java:1267) ~[commons-email-1.2.jar:1.2]
   at com.typesafe.plugin.CommonsMailer.send(MailerPlugin.scala:224) ~[play-plugins-mailer_2.9.1-2.0.2.jar:2.0.2]
   at com.typesafe.plugin.CommonsMailer.send(MailerPlugin.scala:188) ~[play-plugins-mailer_2.9.1-2.0.2.jar:2.0.2]
   at controllers.MobileController.newUserPost(MobileController.java:62) ~[connectlabweb_2.9.1-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
   at Routes$$anonfun$routes$1$$anonfun$apply$3$$anonfun$apply$4.apply(routes_routing.scala:244) ~[connectlabweb_2.9.1-1.0-SNAPSHOT.jar:na]
 Caused by: javax.mail.AuthenticationFailedException: null
   at javax.mail.Service.connect(Service.java:319) ~[mail-1.4.1.jar:1.4.1]
   at javax.mail.Service.connect(Service.java:169) ~[mail-1.4.1.jar:1.4.1]
   at javax.mail.Service.connect(Service.java:118) ~[mail-1.4.1.jar:1.4.1]
   at javax.mail.Transport.send0(Transport.java:188) ~[mail-1.4.1.jar:1.4.1]
   at javax.mail.Transport.send(Transport.java:118) ~[mail-1.4.1.jar:1.4.1]
   at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1232) ~[commons-email-1.2.jar:1.2]

Any ideas why this is happening

here's what is in my application.conf:
# ~~~~~
# Mailer
smtp.host=smtp.gmail.com
smtp.port=587
smtp.ssl=true
smtp.user="<email>"
smtp.password=<password>

keep in mind that this configs worked fine in localhost so password email or host are not wrong.

ty for any help on this matter. Heroku is really driving me crazy, first 1 week lost because of db configs and deployment now another because of mailer configs :\