wood burning stoves 2.0*
The moose likes Java in General and the fly likes javax . mail . MessagingException : 501 HELO requires domain address Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "javax . mail . MessagingException : 501 HELO requires domain address " Watch "javax . mail . MessagingException : 501 HELO requires domain address " New topic
Author

javax . mail . MessagingException : 501 HELO requires domain address

M Sharma
Ranch Hand

Joined: Dec 13, 2001
Posts: 106
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 ....


Regards, Manish
SCJP 1.4
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

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 ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
M Sharma
Ranch Hand

Joined: Dec 13, 2001
Posts: 106
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javax . mail . MessagingException : 501 HELO requires domain address
 
Similar Threads
Email address exixtence verification while sending mail
Problem with SMTPAppender
JavaMail Exception "HELO requires domain address"
Email Address Validation
Email Validation