File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes Can't send command to SMTP host; Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Can Watch "Can New topic

Can't send command to SMTP host;

Hella KG

Joined: Aug 21, 2001
Posts: 1
When I try to send an Email via JAVAMAIL i get this error:
javax.mail.MessagingException: Can't send command to SMTP host;
nested exception is: Socket closed
javax.mail.MessagingException(java.lang.String, java.lang.Exception)
void com.sun.mail.smtp.SMTPTransport.sendCommand(java.lang.String)
void com.sun.mail.smtp.SMTPTransport.close()
void javax.mail.Transport.send0(javax.mail.Message, javax.mail.Address [])
void javax.mail.Transport.send(javax.mail.Message)
void de.hella.mailer.ejb.MailHelper.createAndSendMail(de.hella.mailer.ejb.EMailMessage)
void de.hella.mailer.ejb.MailerBean.sendMail(de.hella.mailer.ejb.EMailMessage)
void de.hella.mailer.ejb.EJSRemoteMailer.sendMail(de.hella.mailer.ejb.EMailMessage)
org.omg.CORBA.portable.OutputStream de.hella.mailer.ejb._EJSRemoteMailer_Tie._invoke(java.lang.String, org.omg.CORBA.portable.InputStream, org.omg.CORBA.portable.ResponseHandler)
What is the problem? Can anyone help me?`
Thanks a lot!
Jamie Young
Ranch Hand

Joined: Jun 19, 2001
Posts: 31
I am not familiar with your problem. I found this solution. I hope it can be of some help.

For JDK 1.2 the mailcap file has to go into jre/lib because that is the actual Java VM lib directory.
Rajjul Singh

Joined: Dec 10, 2008
Posts: 2
Try out by desabling TLS, the cause is that your mail server doesn't use TLS so I just disable it in your mail server like this properties.put("mail.smtp.starttls.enable","false") ;

Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

I very much doubt that was the problem nine years ago. The idea of secured e-mail barely existed then and JavaMail certainly didn't support it.
I agree. Here's the link:
subject: Can't send command to SMTP host;
jQuery in Action, 3rd edition