title: SMTP errors - PHPMailer based app
body: <p>I wrote an app based on PHPMailer that reads a CSV and retrieves the names and email addresses for the recipients (each recipient has a row) and sends emails to them and BCCs the emails to my work address (the same one as the one that sends the emails). It manages to send about 4-5 emails after which it starts returning errors, the most frequent being "SMTP connect() failed". </p>
  
  <p>I use the SMTP server provided by Aruba Italy  - smtp.aruba.it, the one set up for our company email . Its limitations were confirmed to me by the representatives of the company and are max 250 emails sent every 20 minutes and no more than 3-4 simultaneous SMTP connections. Every time I used the app, I sent less than 100 emails in one batch and delayed every other email by one second to not have multiple SMTP connections opened at the same time. </p>
  
  <p>I turned on debugging and read the errors returned but I do not really know how to interpret them. I pasted a few below.  </p>
  
  <p>Could anyone please help me determine what my problem is and how to repair it? </p>
  
  <p>Than you. </p>
  
  <pre><code>2016-12-21 14:19:24 CLIENT -&gt; SERVER: MAIL FROM: 
  2016-12-21 14:19:24 SERVER -&gt; CLIENT: 250 2.1.0 sender ok 
  2016-12-21 14:19:24 CLIENT -&gt; SERVER: RCPT TO: 
  2016-12-21 14:19:24 SERVER -&gt; CLIENT: 250 2.1.5 recipient ok 
  2016-12-21 14:19:24 CLIENT -&gt; SERVER: RCPT TO:
  2016-12-21 14:19:24 SERVER -&gt; CLIENT: 452 4.1.1 NeKD1u00T1ustzm01eKRZu policy violation 
  2016-12-21 14:19:24 SMTP ERROR: RCPT TO command failed: 452 4.1.1 NeKD1u00T1ustzm01eKRZu policy violation 
  2016-12-21 14:19:24 CLIENT -&gt; SERVER: DATA
  2016-12-21 14:19:24 SERVER -&gt; CLIENT: 
  2016-12-21 14:19:24 SMTP ERROR: DATA command failed: 
  2016-12-21 14:19:24 SMTP Error: data not accepted. 
  Message could not be sent.
  Mailer Error: SMTP Error: data not accepted.SMTP server error: DATA command failed
  ------------------------------------------------------------------------------
  
  2016-12-21 14:36:30 CLIENT -&gt; SERVER: MAIL FROM: 
  2016-12-21 14:36:30 SERVER -&gt; CLIENT: 250 2.1.0 sender ok 
  2016-12-21 14:36:30 CLIENT -&gt; SERVER: RCPT TO: 
  2016-12-21 14:36:30 SERVER -&gt; CLIENT: 452 4.1.1 Nec11u00u1ustzm01ecWgz policy violation 
  2016-12-21 14:36:30 SMTP ERROR: RCPT TO command failed: 452 4.1.1 Nec11u00u1ustzm01ecWgz policy violation 2
  016-12-21 14:36:30  CLIENT -&gt; SERVER: RSET 
  2016-12-21 14:36:30 SERVER -&gt; CLIENT: 
  2016-12-21 14:36:30 SMTP ERROR: RSET command failed: 
  2016-12-21 14:36:30 SMTP Error: The following recipients failed: [recipient's email address]: Nec11u00u1ustzm01ecWgz policy violation 
  Message could not be sent.
  Mailer Error: SMTP Error: The following recipients failed: [recipient's email address]: Nec11u00u1ustzm01ecWgz policy violation SMTP server error: RSET command failed
  ------------------------------------------------------------------------------
  
  2016-12-21 14:36:31 SMTP NOTICE: EOF caught while checking if connected 
  2016-12-21 14:36:31 Connection: closed 
  2016-12-21 14:36:31 Connection: opening to ssl://smtps.aruba.it:465, timeout=300, options=array ( ) 
  2016-12-21 14:36:31 Connection: opened 
  2016-12-21 14:36:31 SERVER -&gt; CLIENT: 421 smtpcmd05.ad.aruba.it bizsmtp NecX1u00y1ustzm01 policy violation 
  2016-12-21 14:36:31 CLIENT -&gt; SERVER: EHLO localhost 
  2016-12-21 14:36:31 SERVER -&gt; CLIENT: 503 not available 
  2016-12-21 14:36:31 SMTP ERROR: EHLO command failed: 503 not available 
  2016-12-21 14:36:31 CLIENT -&gt; SERVER: HELO localhost 
  2016-12-21 14:36:31 SERVER -&gt; CLIENT: 503 not available 
  2016-12-21 14:36:31 SMTP ERROR: HELO command failed: 503 not available 
  2016-12-21 14:36:31 SMTP Error: Could not authenticate. 
  2016-12-21 14:36:31 CLIENT -&gt; SERVER: QUIT 
  2016-12-21 14:36:31 SERVER -&gt; CLIENT: 221 2.0.0 smtpcmd05.ad.aruba.it bizsmtp closing connection 
  2016-12-21 14:36:31 Connection: closed 
  2016-12-21 14:36:31 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting 
  Message could not be sent.
  Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
  ------------------------------------------------------------------------------
  
  2016-12-21 14:36:32 Connection: opening to ssl://smtps.aruba.it:465, timeout=300, options=array ( ) 
  2016-12-21 14:36:33 Connection: opened 
  2016-12-21 14:36:33 SERVER -&gt; CLIENT: 421 smtpcmd05.ad.aruba.it bizsmtp NecZ1u00g1ustzm01 policy violation 
  2016-12-21 14:36:33 CLIENT -&gt; SERVER: EHLO localhost 
  2016-12-21 14:36:33 SERVER -&gt; CLIENT: 503 not available 
  2016-12-21 14:36:33 SMTP ERROR: EHLO command failed: 503 not available 
  2016-12-21 14:36:33 CLIENT -&gt; SERVER: HELO localhost 
  2016-12-21 14:36:33 SERVER -&gt; CLIENT: 503 not available 
  2016-12-21 14:36:33 SMTP ERROR: HELO command failed: 503 not available 
  2016-12-21 14:36:33 SMTP Error: Could not authenticate. 
  2016-12-21 14:36:33 CLIENT -&gt; SERVER: QUIT 
  2016-12-21 14:36:33 SERVER -&gt; CLIENT: 221 2.0.0 smtpcmd05.ad.aruba.it bizsmtp closing connection 
  2016-12-21 14:36:33 Connection: closed 
  2016-12-21 14:36:33 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting 
  Message could not be sent.
  Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
  ------------------------------------------------------------------------------
  
  2016-12-21 14:40:46 CLIENT -&gt; SERVER: MAIL FROM: 
  2016-12-21 14:40:46 SERVER -&gt; CLIENT: 
  2016-12-21 14:40:46 SMTP ERROR: MAIL FROM command failed: 
  2016-12-21 14:40:46 The following From address failed: [sender's email address] : MAIL FROM command failed,,,SMTP server error: MAIL FROM command failed 
  Message could not be sent.
  Mailer Error: The following From address failed: [sender's email address]: MAIL FROM command failed,,,SMTP server error: MAIL FROM command failedSMTP server error: MAIL FROM command failed
  </code></pre>