title: Swiftmailer Error: Recipient Rejected
body: <p>I am trying to get Swiftmailer to work but keep getting "recipient rejected" messages.<BR/><BR/>What causes the "recipient rejected" response?  Is this a response from the gmail server (gmail sensing this is SPAM)?  Is there a way to overcome this?  Otherwise, I will abandon Swiftmailer and try <a href="https://stackoverflow.com/questions/303783/phpmailer-vs-swiftmailer">PHPMailer</a>.  I've had success with PEAR packages in the past but got tired of  the configuration and was going to try Swiftmailer first...it shouldn't be this difficult right?
  <BR/></p>
  
  <blockquote>
    <p><strong>My Configuration:</strong><BR/>
    - PHP 5.5.6<BR/>
    - Swiftmailer 5.0.3 (with Logger Plugin)<BR/>
    - Hosting by GoDaddy <em>(yeah...I know)</em></p>
    
    <p><strong>Goal:</strong>  Use Swiftmailer to send SMTP message from <strong>admin@mydomain.org</strong> to <strong>legit@gmail.com</strong>
    <BR/> <em>(obviously the email addresses are placeholders for actual addresses)</em></p>
  </blockquote>
  
  <p><BR/>Here is the PHP code:  (same as example in Swiftmailer <a href="http://swiftmailer.org/docs/sending.html" rel="nofollow noreferrer">documentation</a>)</p>
  
  <pre><code>&lt;?php 
      require_once 'lib/swift_required.php';
  
      $transport = Swift_SmtpTransport::newInstance('smtp.mydomain.org', 25)
        -&gt;setUsername('admin@mydomain.org')
        -&gt;setPassword('mypassword')
        ;
  
      $mailer = Swift_Mailer::newInstance($transport);
  
  
      $logger = new Swift_Plugins_Loggers_EchoLogger();
      $mailer-&gt;registerPlugin(new Swift_Plugins_LoggerPlugin($logger));
  
      $message = Swift_Message::newInstance('Wonderful Subject')
        -&gt;setFrom(array('admin@mydomain.org' =&gt; 'admin'))
        -&gt;setTo(array('legit@gmail.com' =&gt; 'recipient'))
        -&gt;setBody('Here is the message itself')
        ;
  
      $result = $mailer-&gt;send($message);
      echo $logger-&gt;dump();
  ?&gt;
  </code></pre>
  
  <p>Here is the relevant logger info:</p>
  
  <pre><code>    ...
      ++ Swift_SmtpTransport started
      ...
      &gt;&gt; RCPT TO: &lt;legit@gmail.com&gt;
      &lt;&lt; 550 5.1.1 &lt;legit@gmail.com&gt; recipient rejected
      !! Expected response code 250/251/252 but got code "550", with message "550 5.1.1 &lt;legit@gmail.com&gt; recipient rejected "
      &gt;&gt; RSET
      &lt;&lt; 250 2.0.0 OK
      ++ Stopping Swift_SmtpTransport
      &gt;&gt; QUIT
  </code></pre>