title: PHPMailer: You must provide at least one recipient email address
body: <p>I'm using <a href="https://github.com/PHPMailer/PHPMailer" rel="noreferrer">PHPMailer</a> on my website, but it returns an error: </p>
  
  <p><strong>You must provide at least one recipient email address.</strong></p>
  
  <p>The server is running PHP 7. I've checked out the following pages looking for answers: </p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/8297367/php-mailer-you-must-provide-at-least-one-email-address">PHP Mailer You must provide at least one email address</a></li>
  <li><a href="https://stackoverflow.com/questions/13188954/php-mailer-error-mailer-error-must-provide-at-least-one-recipient-email-addre">PHP Mailer Error: Mailer Error - must provide at least one recipient email address</a></li>
  <li><a href="https://github.com/PHPMailer/PHPMailer/issues/441" rel="noreferrer">https://github.com/PHPMailer/PHPMailer/issues/441</a></li>
  <li><a href="https://github.com/PHPMailer/PHPMailer/issues/429" rel="noreferrer">https://github.com/PHPMailer/PHPMailer/issues/429</a></li>
  </ul>
  
  <p>None of those solved my problem. </p>
  
  <p>This is the way it's set up: </p>
  
  <pre><code>require_once 'lib/phpmailer/PHPMailerAutoload.php';
  
  $m = new PHPMailer;
  
  $m-&gt;isSMTP();
  $m-&gt;SMTPAuth = true;
  $m-&gt;SMTPDebug = 2;
  
  $m-&gt;Host = 'smtp.zoho.com';
  $m-&gt;Username = 'email@email.com';
  $m-&gt;Password = 'password';
  $m-&gt;SMTPSecure = 'ssl';
  $m-&gt;Port = 465;
  
  $m-&gt;From = 'email@email.com';
  $m-&gt;FromName = 'Name';
  
  $m-&gt;Subject = 'Testing PHPMailer';
  $m-&gt;Body = 'Body of the email. Testing PHPMailer.';
  
  if (!$m-&gt;send()) {
      echo 'Mailer Error: ' . $m-&gt;ErrorInfo;
  } else {
      echo 'Everything OK.';
  }
  </code></pre>
  
  <p>Doing <code>var_dump(PHPMailer::validateAddress('email@email.com'));</code> returns <code>true</code>. So the email address doesn't seem to be the issue. </p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Adding <code>$m-&gt;AddAddress = email@email.com</code> doesn't solve the issue. It returns the exact same error. </p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>Have added $m->addAddress('email@email.com') to the code. I had been doing that wrong. It now returns a 500 error. </p>
  
  <p><strong>EDIT 3</strong> </p>
  
  <p>Turns out I mistyped the addAddress in my code (I misplaced a quote, which caused the 500 error). The provided answer stands. I did not properly add a recipient. </p>
  
  <p>My apologies for troubling you with this. I should've more carefully looked at the PHPMailer example provided, instead of blindly following a third part tutorial. </p>