• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaMail: Help with sending e-mails

 
David Houghton
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • 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

 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • 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
  • 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


 
Paul Clapham
Sheriff
Posts: 21002
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic