I am learning to send an email from my java application. I am using jdk1.6, jboss AS 7.1.1 and I have downloaded the latest JavaMail api and JAF jars.
I have tried this tutorial from tutorialspoint
And I am getting this error.
I have no clue what this error is. Is there anything needs to configured? Do I need an smtp server? if so how integrate it with jboss. And also if you could suggest a good tutorial for the same.
Yes, the JavaMail API just interfaces with mail servers, it doesn't implement one. There are several free SMTP servers you could install for testing. You could also connect to your company's mail server, or if you have a gmail account, I believe you can connect to their SMTP server.
There's also a fake SMTP server implementation called Dumbster that you can run to accept emails but not actually send them out. Useful for testing purposes. Otherwise, your ISP probably has a mail gateway that you can use.
I second Junilu's suggestion. I've used Dumbster before, very useful for testing. It basically captures outgoing messages by listening on a particular port. You can even open the captured messages in your own email client (e.g. Outlook) to check their format and content. And on top of that, no emails are actually sent to the recipient but you can obviously see what the intended 'to' address is.
Joined: Aug 12, 2009
I resolved this by using Apache James mail server. I am able to send mail through Gmail.