Java mail SMTP From address required

258 views
Skip to first unread message

Hanxue Lee

unread,
Sep 25, 2013, 3:51:01 PM9/25/13
to play-fr...@googlegroups.com
Hello,


I am trying to use Play Framework to send out email. In applications.conf, when I set smtp.mock=true , it works perfectly well:


[info] application - HTML: Welcome to Play20StartApp. <br> Click on this link : http://localhost:9000/confirm/d77ea256-0d2e-4df5-b66e-e034159f8042 to confirm your email.<br><br>--<br>null
[debug] application - Mail sent - SMTP:smtp.google.com:465 SSL:yes user:user...@gmail.com password:password


However, when I comment smtp.mock=true and attempt to send real emails, I get this error:

[debug] application - Mail.sendMail: Mail will be sent to us...@gmail.com
[ERROR] [09/26/2013 03:46:05.014] [application-akka.actor.default-dispatcher-2] [TaskInvocation] From address required
org.apache.commons.mail.EmailException: From address required


I have set smtp.user to a proper value, i.e. ser...@businessdomain.com . Any idea what causes this error?


Notes:

1. The emails used are real emails, and redacted above. Likewise, a real domain name is used
2. Tested with a working local mail server (exim), as well as directly sending through Gmail (smtp.google.com) and Google Apps (aspmx.l.google.com) servers. These settings have been verified using mail clients. 

virtualeyes

unread,
Oct 9, 2013, 3:28:39 AM10/9/13
to play-fr...@googlegroups.com
Getting the same here, worked previously, only difference on my end is using a Future:
val async: Future[Unit] = Future{mail.send(body)}
async
.onFailure{case(e)=>
 
Logger.error("mailer failed due to: "+ e.getMessage)
}

With Futures do we need to add to/from/subject within the future closure, or can that happen outside of that?



On Wednesday, September 25, 2013 9:51:01 PM UTC+2, Hanxue Lee wrote:
Hello,


I am trying to use Play Framework to send out email. In applications.conf, when I set smtp.mock=true , it works perfectly well:
[info] application - HTML: Welcome to Play20StartApp. <br> Click on this link : http://localhost:9000/confirm/d77ea256-0d2e-4df5-b66e-e034159f8042 to confirm your email.<br><br>--<br>null
[debug] application - Mail sent - SMTP:smtp.google.com:465 SSL:yes user:u...@gmail.com password:password


However, when I comment smtp.mock=true and attempt to send real emails, I get this error:

[debug] application - Mail.sendMail: Mail will be sent to us...@gmail.com
[ERROR] [09/26/2013 03:46:05.014] [application-akka.actor.default-dispatcher-2] [TaskInvocation] From address required
org.apache.commons.mail.EmailException: From address required


Reply all
Reply to author
Forward
0 new messages