title: Connection reset by Alert in Mirth
body: <p>I am trying to set up an alert for a channel to send emails. The problem is that when a channel produces an alert, on having tried to send e-mail the mistake takes place: "Connection reset". The server of mail is external to the company.</p>
  
  <p>To prove the sending of message in Mirth, I have defined a channel that when it receives a hl7 message sends a mail to a certain direction with the following code javascript:</p>
  
  <pre><code>var smtpConn = SMTPConnectionFactory.createSMTPConnection();
  smtpConn.send('example1@mailserver.es', '', 'example2@mailserver.es', 'subject', 'body');
  logger.info('mensaje enviado');
  </code></pre>
  
  <p>Producing the same mistake:</p>
  
  <pre><code>Caused by: javax.mail.MessagingException: Exception reading response;
    nested exception is:
      java.net.SocketException: Connection reset
      at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1925)
      at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1684)
      at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:525)
      at javax.mail.Service.connect(Service.java:313)
      at javax.mail.Service.connect(Service.java:172)
      at javax.mail.Service.connect(Service.java:121)
      at javax.mail.Transport.send0(Transport.java:190)
      at javax.mail.Transport.send(Transport.java:120)
      at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1232)
  </code></pre>
  
  <p>The Setting configuration is:</p>
  
  <p>SMTP Host: ipsmtphostserver, Port: 465,SendTimeOut:2000,DefaultFromAccess:anyemail@mail.com, SecureConnection:I have tried with both TTL and SSL,RequiereAuthentication: Yes.</p>
  
  <p>I have thought that the problem was firewall or antivirus, but I have deactivated a moment them and it follows the problem.</p>