Sending e-mails using JavaMail API
Spring framework provides classes such as JavaMailSenderImpl
, SimpleMailMessage
, and so on, which simplify sending e-mails via JavaMail API. In this recipe, we'll look at Roo commands that help with the configuration of these classes. To verify that the emailing feature in our application is working correctly, we'll send an e-mail via Gmail.
Getting ready
Create a new directory C:\roo-cookbook\ch06-email
in your system. Copy the ch06_web_app.roo
script to the ch06-email
directory. If you are using a different database than MySQL or your connection settings are different than what is specified in the script, then modify the script accordingly.
Start the Roo shell from the ch06-email
directory and execute the ch06_web_app.roo
script using the script
command. Executing the Roo script will create a flightapp-web
eclipse project that represents a Spring Web MVC application consisting of Flight
and FlightDescription
JPA entities.
How to do it...
To simplify e-mail...