aspose file tools*
The moose likes JSF and the fly likes MAILING EXCEPTION:[EOF] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "MAILING EXCEPTION:[EOF]" Watch "MAILING EXCEPTION:[EOF]" New topic
Author

MAILING EXCEPTION:[EOF]

satyanarayana bnv
Greenhorn

Joined: Aug 07, 2008
Posts: 12
Hi,

I my application I am trying to send an email using JavaMail API. I have written the code as .

try
{
Properties props=new Properties ();
props.put("mail.smtp.host","HOSTNAME");
Session session = Session.getInstance (props, null);
Message message =new MimeMessage (session);
message.setFrom(new InternetAddress("XYZ@DOMAIN.com"));
message.setRecipients(Message.RecipientType.TO,InternetAddress.parse("XYZ@DOMAIN.com",true));
message.setSubject("hai");
message.setText("hello");
Transport.send(message);
System.out.println("mail has been sent");
}
catch(MessagingException ex)
{
System.out.println("ERROR....."+ex);
}

While I am trying to run this I am getting an Exception as follows´┐Ż

ERROR.....javax.mail.MessagingException: [EOF]

I have no idea where might I have gone wrong.
Can anyone please help me if you have come across this kind of exception.


Thanks & regards,

Satyanarayana.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MAILING EXCEPTION:[EOF]