プロジェクトに play 2.0 を使用しており、ユーザーにメールを送信しようとしています。このプラグイン [https://github.com/typesafehub/play-plugins/tree/master/mailer] を使用しています。
Build.scala に追加しました
"com.typesafe" %% "play-plugins-mailer" % "2.0.4"
そして conf/play.plugins で
1500:com.typesafe.plugin.CommonsMailerPlugin
私のconf/application.confには設定があります
smtp.host=smtp.gmail.com
smtp.port=25
smtp.ssl=true
smtp.tls=false
smtp.username="test@gmail.com"
smtp.password="xxxxxxx"
私のコントローラーアクションは
public static Result sendEmail(String recipt, String title, String sender ){
MailerAPI mail = play.Play.application().plugin(MailerPlugin.class).email();
mail.setSubject(SUBJECT);
mail.addRecipient(recipt);
mail.addFrom(sender);
String body = views.html.teams.mailBody.render(recipt, title, sender).body();
mail.sendHtml(body);
return ok();
}
次のエラーが表示されます
[EmailException: Sending the email to the following server failed : smtp.gmail.com:25]
私が間違っていること。どんな助けでも大歓迎です。
ありがとう