application.conf
play.mailer {
host=smtp.gmail.com
port=25
ssl=true
tls=false
user="wahid.****.com"
password="A******f"
debug=false
mock=false
}
build.sbt
"com.typesafe.play" %% "play-mailer" % "5.0.0"
My Controller
public class MySampleMail {
@Inject MailerClient mailerClient;
public void sendEmail() {
String cid = "1234";
Email email = new Email()
.setSubject("Simple email")
.setFrom("wahid.************.com")
.addTo("w***********.com")
.setBodyText("A text message");
mailerClient.send(email);
}
}
But This send(email) is giving Execution exception[[CompletionException: java.lang.NullPointerException]]
Try out this:
}