0

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
2
Contributors
1
Reply
3
Views
5 Years
Discussion Span
Last Post by ztini
0

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.

http://james.apache.org/

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.

http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.