I wrote a program to send mail from my gmail account using scala Play 2.3.8 then i got the following exception:
[EmailException: Sending the email to the following server failed : smtp.gmail.com:465] at MailerPlugin.send(email)
my code is as follows:
val email = Email(
"A personal mail",
"LeeSa <xxxxxx@gmail.com>",
Seq("Recepient <yyyyyy@gmail.com>"),
// adds attachment
attachments = Seq(
),
bodyHtml = Some("""
<html>
<body>
<h3>Hai ,</h3>
<p> This is a test message. </p>
</body>
</html>
""")
)
MailerPlugin.send(email)
application.conf contains the configuration
smtp.host=smtp.gmail.com
smtp.port=465
smtp.ssl=yes
smtp.tls=yes
smtp.user="xxxxxxx@gmail.com"
smtp.password="MyPassword"
Anyone can help me?