posted 15 years ago
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.