title: PHPmailer not working recipient
body: <p>I have a problem, with my code beneath I get this error message:
  Message could not be sent.Mailer Error: SMTP Error: The following recipients failed: !Censored!</p>
  
  <p>I have looked into the Host, Port, Username, Password, Recipient and all is correct, what is the problem? Thank you!</p>
  
  <p>Could you please explain too cuz Im new to PHP-coding</p>
  
  <pre><code> &lt;?php
  require 'PHPMailerAutoload.php';
  
  $mail = new PHPMailer;
  
  $name = $_POST['name'];
  $email = $_POST['email'];
  $subject = $_POST['amne'];
  $message = $_POST['message'];
  
  //$mail-&gt;SMTPDebug = 3;                               // Enable verbose debug output
  
  $mail-&gt;isSMTP();                                      // Set mailer to use SMTP
  $mail-&gt;Host = '!Censored!';  // Specify main and backup SMTP servers
  $mail-&gt;SMTPAuth = true;                               // Enable SMTP authentication
  $mail-&gt;Username = '!Censored!';                 // SMTP username
  $mail-&gt;Password = '!Censored!';                           // SMTP password
  $mail-&gt;SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted
  $mail-&gt;Port = 587;                                    // TCP port to connect to
  
  $mail-&gt;From = $email;
  $mail-&gt;FromName = $name;
  $mail-&gt;addAddress('!Censored!');     // Add a recipient
  
  $mail-&gt;addAttachment('/var/tmp/file.tar.gz');         // Add attachments
  $mail-&gt;addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name
  $mail-&gt;isHTML(true);                                  // Set email format to HTML
  
  $mail-&gt;Subject = $subject;
  $mail-&gt;Body    = $message;
  $mail-&gt;AltBody = $message;
  
  if(!$mail-&gt;send()) {
      echo 'Message could not be sent.';
      echo 'Mailer Error: ' . $mail-&gt;ErrorInfo;
  } else {
      echo 'Message has been sent';
  }
  </code></pre>
  
  <p>EDIT: I found the problem, the problem was not in the php code itself. It was in the contact form. The problem started when I put the variables as names and emails. If the email is not verified, it does not work. </p>