title: JavaMail - Invalid HELO name
body: <p>I used to run a server app that sends an e-mails each 2 hours, but sometimes i get the error below:</p>
  
  <pre><code>Não foi possível enviar a mensagem.
  Mensagem: com.sun.mail.smtp.SMTPSendFailedException: 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1)
  
  Jan 07, 2013 1:00:32 PM job_hidrojato.comunicacao.email.Email run
  SEVERE: null
  com.sun.mail.smtp.SMTPSendFailedException: 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1)
  
  at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
  at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959)
  at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583)
  at javax.mail.Transport.send0(Transport.java:169)
  at javax.mail.Transport.send(Transport.java:98)
  at job_hidrojato.comunicacao.email.Email.run(Email.java:186)
  at java.lang.Thread.run(Thread.java:722)
  </code></pre>
  
  <p>I've already tried to explicitly define the mail.smtp.localhost using the code below, where "HADES" is the hostname of my server, but it didn't work.</p>
  
  <pre><code>props.put("mail.smtp.localhost", "HADES");
  </code></pre>
  
  <p>The error log gerenated after this change is the same, so I think that the problem isn't the hostname parameter. I already read the links below but again, didn't work, so I'm running out of alternatives to solve this problem, and any help would be appreciated :)</p>
  
  <p><a href="https://stackoverflow.com/questions/4934373/invalid-helo-name-in-javamail">Invalid HELO name in JavaMail</a></p>
  
  <p><a href="https://stackoverflow.com/questions/8542616/550-access-denied-invalid-helo-name">550 Access denied - Invalid HELO name</a></p>