I am having trouble understanding how to set up the smtp property. I do not have
internet connection now. I wanted to use my Outlook or something. What do I do
to get Glassfish to generate emails so I can begin learning how to code my app to
send emails by gathering props and properties from my db?

//java mail inserted
        String smtpServer = "model.mail.SimpleSender";
        String to = "cisumma@hotmail.com";
        String from = "cisumma@hotmail.com";
        String subject = "Hello Mail World subject";
        String body = "Hello Mail World body";
        SimpleSender ss = new SimpleSender();
        ss.send(smtpServer, to, from, subject, body);
        //java mail inserted

Apache's James server will probably meet your requirements. This is an open source email server that supports SMTP/POP3/NNTP. It is built upon the javax.mail package and complies (for the most part) with RFC2822, the commonly accepted emails standard.


Once you have James up and running, you can send emails using the SMTP protocol from your application to James. This is simply a matter of opening a socket on port 25.


I've used this approach with much success in the past to solve small scale SMTP/POP3 integration with my applications.