title: phpmailer smtp not working
body: <p>I've been trying for quite a while now, and I can't get phpmailer working with smtp.
  I've been testing here <a href="http://smtper.sweetylife.com/" rel="nofollow">http://smtper.sweetylife.com/</a> to see if my smtp was working at all, and  on this site I could connect without any problems.
  My phpmailer settings are:</p>
  
  <pre><code>    $mail   = new PHPMailer();
      $mail-&gt;IsSMTP(); // telling the class to use SMTP
      $mail-&gt;Host       = "mail.mydomain.com"; // SMTP Server
      $mail-&gt;SMTPDebug  = 2; // Debugmode
      $mail-&gt;SMTPAuth   = true; // enable SMTP authentication
      $mail-&gt;SMTPSecure = "tls";
      $mail-&gt;Port       = 587; // set the SMTP port for the GMAIL
      $mail-&gt;Username   = "administratie@mydomain.com"; // SMTP account username
      $mail-&gt;Password   = "password";        // SMTP account password
      //$mail-&gt;SetFrom("administratie@mydomain.com", "First Last");
      $mail-&gt;AddReplyTo("administratie@mydomain.com","First Last");
      $mail-&gt;Subject    = "PHPMailer Test Subject via smtp, basic with authentication";
      //$mail-&gt;AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
      $mail-&gt;Body       = "demo mail";
      $address = "re@ceiv.ed";
      $mail-&gt;AddAddress($address, "John Doe");
      if(!$mail-&gt;Send()) {
          echo "Mailer Error: " . $mail-&gt;ErrorInfo;
      }
      else{
          echo "Message sent!";
      }
  </code></pre>
  
  <p>But it's not working.
  I get the following error:</p>
  
  <pre><code>SMTP -&gt; FROM SERVER: 220 helios.web.xyn-ta.net ESMTP Exim 4.77 Mon, 14 May 2012 11:47:16 +0200
  SMTP -&gt; FROM SERVER: 250 helios.web.xyn-ta.net Hello localhost.localdomain [77.243.225.73]
  SMTP -&gt; FROM SERVER: 250 OK
  SMTP -&gt; FROM SERVER: 550 relay not permitted, authentication required
  SMTP -&gt; ERROR: RCPT not accepted from server: 550 relay not permitted, authentication required
  SMTP -&gt; FROM SERVER: 503-All RCPT commands were rejected with this error:
  503-relay not permitted, authentication required
  503 valid RCPT command must precede DATA
  SMTP -&gt; ERROR: DATA command not accepted from server: 503-All RCPT commands were rejected with this error:
  503-relay not permitted, authentication required
  503 valid RCPT command must precede DATA
  SMTP -&gt; FROM SERVER: 221 helios.web.xyn-ta.net closing connection
  Mailer Error:
  </code></pre>
  
  <p>I have no idea what I've been doing wrong, does anyone have a solution to fix this?</p>