J F W

making web application programming easier is possible

HOW TO : CORE

send an email

To send an email, the class SendEmail can be used.

When you create the instance, you have to pass as parameter, the name of the mail server.

You can use this constructor to pass also the login data for the mail server:

If you want to use the default parameters (defined in jfw.properties) then you can use this constructor:

You can set the content type of the mail using the method setContentType. The default content type is plain.
You can also set the port of the mail server and the type of connection (SSL or normal) using methods setPort and setIsSecure.

By default the mail is send asynchronously; if you prefer to wait until the mail is sent you have to do this:

Then, to send the email, you have to use one of the methods send: