title: Send Email using Amazon SES and PHP Mailer from localhost
body: <p>I am developing a PHP application where I am trying to send an email for testing purposes. I am using PHPMailer and Amazon SES. Currently, I am in development mode so that software isn't online and I am working from localhost (Xampp). The problem is that the email is not being sent despite of my username, password and all the details being correct.</p>
  
  <p>This is the following code that I am using right now. </p>
  
  <pre><code>&lt;?php
  use PHPMailer\PHPMailer\PHPMailer;
  use PHPMailer\PHPMailer\Exception;
  require 'phpmailer/src/Exception.php';
  require 'phpmailer/src/PHPMailer.php';
  require 'phpmailer/src/SMTP.php';
  
  $mail = new PHPMailer;
  $mail-&gt;isSMTP();
  $mail-&gt;SMTPDebug = 0;
  $mail-&gt;Host = 'email-smtp.us-east-1.amazonaws.com';
  $mail-&gt;Port = 587;
  $mail-&gt;SMTPSecure = 'tls';
  $mail-&gt;IsHTML(true);
  $mail-&gt;SMTPAuth = true;
  $mail-&gt;Username = 'HIDDEN';
  $mail-&gt;Password = 'HIDDEN';
  $mail-&gt;setFrom('zoomkraft1000@gmail.com', 'DateApp');
  $mail-&gt;addAddress('shubhamjha1000@gmail.com', 'Shreyansh');
  $mail-&gt;Subject = 'This is a subject.';
  $mail-&gt;Body    = 'This is a test message.';
  
  if($mail-&gt;send()){
    echo "Mail sent!";
  }else{
    echo "Error";
  }
  
  ?&gt;
  </code></pre>
  
  <p>I am always receiving "Error" message as the mail is not being sent. Please if anybody can let me know what the issue is, I will be grateful. Is it because I am on localhost? Or, would I have to configure my php.ini file to send mails? If yes, please let me know the process.</p>
  
  <p>UPDATE</p>
  
  <ol>
  <li><p>Its not working online as well. I just tried it. You can see here <a href="http://www.startdating.in/test.php" rel="nofollow noreferrer">http://www.startdating.in/test.php</a></p></li>
  <li><p>I forgot to mention that I did not configure the domain thing in amazon ses account. I only configured email and SMTP services. </p></li>
  </ol>
  
  <p>CHANGED DEBUG to 1</p>
  
  <p>ERROR MESSAGE FROM LOCALHOST</p>
  
  <pre><code>2019-10-12 18:25:25 CLIENT -&gt; SERVER: EHLO localhost
  2019-10-12 18:25:26 CLIENT -&gt; SERVER: STARTTLS
  2019-10-12 18:25:27 CLIENT -&gt; SERVER: EHLO localhost
  2019-10-12 18:25:27 CLIENT -&gt; SERVER: AUTH LOGIN
  2019-10-12 18:25:27 CLIENT -&gt; SERVER: &lt;credentials hidden&gt;
  2019-10-12 18:25:27 CLIENT -&gt; SERVER: &lt;credentials hidden&gt;
  2019-10-12 18:25:27 CLIENT -&gt; SERVER: MAIL FROM:&lt;zoomkraft1000@gmail.com&gt;
  2019-10-12 18:25:28 CLIENT -&gt; SERVER: RCPT TO:&lt;shubhamjha1000@gmail.com&gt;
  2019-10-12 18:25:28 CLIENT -&gt; SERVER: DATA
  2019-10-12 18:25:28 CLIENT -&gt; SERVER: Date: Sat, 12 Oct 2019 20:25:24 +0200
  2019-10-12 18:25:28 CLIENT -&gt; SERVER: To: Shreyansh &lt;shubhamjha1000@gmail.com&gt;
  2019-10-12 18:25:28 CLIENT -&gt; SERVER: From: DateApp &lt;zoomkraft1000@gmail.com&gt;
  2019-10-12 18:25:28 CLIENT -&gt; SERVER: Subject: This is a subject.
  2019-10-12 18:25:28 CLIENT -&gt; SERVER: Message-ID: &lt;wOLtFTSGmh2slZxkUcYhUA4lc0sTi0UdiiDHjUzbGs@localhost&gt;
  2019-10-12 18:25:28 CLIENT -&gt; SERVER: X-Mailer: PHPMailer 6.0.6 (https://github.com/PHPMailer/PHPMailer)
  2019-10-12 18:25:28 CLIENT -&gt; SERVER: MIME-Version: 1.0
  2019-10-12 18:25:28 CLIENT -&gt; SERVER: Content-Type: text/html; charset=iso-8859-1
  2019-10-12 18:25:28 CLIENT -&gt; SERVER:
  2019-10-12 18:25:28 CLIENT -&gt; SERVER: This is a test message.
  2019-10-12 18:25:28 CLIENT -&gt; SERVER:
  2019-10-12 18:25:28 CLIENT -&gt; SERVER: .
  2019-10-12 18:25:29 SMTP ERROR: DATA END command failed: 554 Message rejected: Email address is not verified. The following identities failed the check in region US-EAST-1: shubhamjha1000@gmail.com
  SMTP Error: data not accepted.
  Error2019-10-12 18:25:29 CLIENT -&gt; SERVER: QUIT
  </code></pre>
  
  <p>ERROR MESSAGE FROM www.stardating.in/test.php</p>
  
  <pre><code>2019-10-12 18:25:53 SMTP ERROR: Failed to connect to server: Connection refused (111)
  SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
  Error
  </code></pre>
  
  <p>Also, I have configured and verified stardating.in domain name in the amazon ses account. Still the problem persists.</p>