• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

JavaMail: Help with sending e-mails

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi people, any help here would be great. Just so you know, this is my first venture into the JavaMail API. When i run my class below, a javax.mail.MessagingException is thrown, with the outptu [EOF]

Any ideas on why this is happening would be great. The trans connection to the smtpServer seems to be working fine, it is the sendMessage() method which i s throwing the exception

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Inserting a call to " session.setDebug(true) " will cause lots of info about what's happening to be written to standard out; often that includes something that points to the problem.
 
David Houghton
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ulf, i identified the problem using the session debug. My coding was fine, i was trying to test it with an e-mail address using the worng protocol to connect to the server (i think!) Anyways, i am able to send e-mail via SMTP which is great.

I am however having a problem with retrieiving message from the server. I am able to retreive unread messages, but not read messages. the call to folder.getMessages() only seems to be retrieving unread messages


 
Sheriff
Posts: 28323
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're going to be working with JavaMail, and you don't know much about how e-mail works, I would recommend you have a read through the JavaMail FAQ. The question you have asked is one of the many which is answered there.
 
David Houghton
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Paul ive had a read through the FAQs. Ive found out that my messages are deleted from my server once they have been retrieved, which is why i cannot retrieve unread messages!

I though i had found a way around this using message FLAGS, but ive just read that pop3 doesnt support flags!

Would i be write in saying that the only way to access read e-mails would be to store them on the client machine once read?

Thanks

Dave
 
Could you hold this puppy for a sec? I need to adjust this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic