Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javax . mail . MessagingException : 501 HELO requires domain address

 
M Sharma
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help me why am i getting "javax.mail.MessagingException: 501 HELO requires domain address" this exception while sending mail, using JavaMail..... Can anyone help me on this ....
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you may not be properly registering the SMTP server that JavaMail is to use. Without that, how would it know where to send the mail through?
The following code snippets should give you enough clues:

hthm
bear
[ May 03, 2002: Message edited by: Bear Bibeault ]
 
M Sharma
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try {
Properties props = System.getProperties();
props.put("mail.smtp.host", "10.100.7.104");
Session sessionx = Session.getDefaultInstance(props, null);
javax.mail.Message message = new javax.mail.internet.MimeMessage(sessionx);
message.setSubject(mailSubject);
message.setFrom(new InternetAddress(mailFrom));
message.addRecipient(javax.mail.Message.RecipientType.TO, new nternetAddress(mailTo));
message.setContent(mailBody, "text/html");
Transport.send(message);
}
catch(Exception e)
{
out.println(e);
}

This the code snippet which i am using in my jsp page. I moved the same code on the different testing server of my company, where it worked. But i wanted to know why it gave me "javax.mail.MessagingException: 501 HELO requires domain address" exception in the first server. I am using tomcat web server. My SMTP Server is accessible, as i can telnet and connect to that server. So i wanted to know the reason for this exception and how it can be avoided.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic