MailPlugin error:Generic error: Exception reading response

195 views
Skip to first unread message

MG

unread,
Apr 7, 2012, 8:01:24 PM4/7/12
to play-fr...@googlegroups.com
Hi - The MailPlugin throws an exception a few seconds after the following code is executed:

def sendMail = Action { request =>
        val m = Mail()
                    .from("Bibi","no-r...@bibi.com")
                    .to(List(("Toto","to...@bibi.com",To())))
                    .subject("A subject")
                    .html(views.html.mail())
        MailPlugin.send(m)
        Ok("It works")
    }

It is the sample code from the plugin's readme file. I modified the conf file so that it connects to a real SMTP server.


Here is the exception that is thrown:


2012-04-07 16:51:35,700 ERROR Mailer - Exception reading response
javax.mail.MessagingException: Exception reading response;
  nested exception is:
        java.net.SocketException: Connection reset
        at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java
:1611)
        at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1369)
        at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:41
2)
        at javax.mail.Service.connect(Service.java:310)
        at javax.mail.Service.connect(Service.java:169)
        at javax.mail.Service.connect(Service.java:118)
        at org.codemonkey.simplejavamail.Mailer.sendMail(Mailer.java:236)
        at play.modules.mail.MailWorker$$anonfun$receive$1.apply(MailWorker.scal
a:23)
        at play.modules.mail.MailWorker$$anonfun$receive$1.apply(MailWorker.scal
a:19)
        at akka.actor.Actor$class.apply(Actor.scala:290)
        at play.modules.mail.MailWorker.apply(MailWorker.scala:17)
        at akka.actor.ActorCell.invoke(ActorCell.scala:617)
        at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:179)
        at akka.dispatch.Mailbox.run(Mailbox.scala:161)
        at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(
AbstractDispatcher.scala:505)
        at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259)
        at akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:997)
        at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1495)
        at akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
Caused by: java.net.SocketException: Connection reset
        at java.net.SocketInputStream.read(SocketInputStream.java:168)
        at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:110)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
        at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:88)
        at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java
:1589)
        ... 18 more
[error] application - MailPlugin error:Generic error: Exception reading response


I will appreciate any help in getting it resolved.

Thanks,
MG

MG

unread,
Apr 9, 2012, 11:16:22 AM4/9/12
to play-fr...@googlegroups.com
Interestingly, the error went away after I switched to another SMTP server provided by a different service provider.


On Saturday, April 7, 2012 5:01:24 PM UTC-7, MG wrote:
Hi - The MailPlugin throws an exception a few seconds after the following code is executed:

def sendMail = Action { request =>
        val m = Mail()
                    .from("Bibi","no-reply@bibi.com")
                    .to(List(("Toto","toto@bibi.com",To())))
                    .subject("A subject")
                    .html(views.html.mail())
        MailPlugin.send(m)
        Ok("It works")
    }
Reply all
Reply to author
Forward
0 new messages