• 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

MAILING EXCEPTION:[EOF]

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic