Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error Sending mail using JavaMail.

 
Hasif Subair
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 2985
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7466
50
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Hasif Subair
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to a more suitable forum
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I resolved this by using Apache James mail server. I am able to send mail through Gmail.
 
Hasif Subair
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For anyone looking having similar issues can try this tutorial here http://www.mastertheboss.com/jboss-application-server/379-jboss-mail-service-configuration.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic