• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error Sending mail using JavaMail.

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to a more suitable forum
 
Bartender
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
No, tomorrow we rule the world! With this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic