| Author |
Error Sending mail using JavaMail.
|
Hasif Subair
Greenhorn
Joined: Aug 12, 2009
Posts: 24
|
|
Hi,
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.
Any help will be very much appreciated.
Thanks,
Hasif
|
 |
Greg Charles
Bartender
Joined: Oct 01, 2001
Posts: 2536
|
|
|
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.
|
 |
Junilu Lacar
Bartender
Joined: Feb 26, 2001
Posts: 4115
|
|
|
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.
|
Junilu - [How to Ask Questions] [How to Answer Questions] [MiH]
|
 |
Hasif Subair
Greenhorn
Joined: Aug 12, 2009
Posts: 24
|
|
Thanks you both for your reply.
@Greg Charles
Can you give me a working code or tutorial for sending mail through gmail. I have tried a few from the net, but none is working.
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8434
|
|
|
Moving to a more suitable forum
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
James Boswell
Ranch Hand
Joined: Nov 09, 2011
Posts: 657
|
|
|
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.
|
 |
Hasif Subair
Greenhorn
Joined: Aug 12, 2009
Posts: 24
|
|
|
I resolved this by using Apache James mail server. I am able to send mail through Gmail.
|
 |
Hasif Subair
Greenhorn
Joined: Aug 12, 2009
Posts: 24
|
|
|
For anyone looking having similar issues can try this tutorial here http://www.mastertheboss.com/jboss-application-server/379-jboss-mail-service-configuration.html
|
 |
 |
|
|
subject: Error Sending mail using JavaMail.
|
|
|