title: PHP Mailer Error: Mail Address Not Valid
body: <p>I would like to send an email using Gmail SMTP server through PHP Mailer.</p>
  
  <p>I am running Zend Server Community Edition in my machine.</p>
  
  <p>Following is my code (edited to hide certain confidential information).</p>
  
  <pre><code> require_once('phpmailer/class.phpmailer.php');
  
          $mail             = new PHPMailer();
  
          $body             = "test msg";
  
          $mail-&gt;IsSMTP();
          $mail-&gt;SMTPDebug  = 2;                    
  
          $mail-&gt;SMTPAuth   = true;                  
          $mail-&gt;SMTPSecure = "tls";                 
          $mail-&gt;Host       = "smtp.gmail.com";      
          $mail-&gt;Port       = "587";                    
          $mail-&gt;Username   = "&lt;valid-id&gt;";  
          $mail-&gt;Password   = "&lt;valid-password&gt;";            
  
          $mail-&gt;SetFrom('a@b.c', 'Name');
  
          $mail-&gt;AddReplyTo("a@b.c","Name");
  
          $mail-&gt;Subject    = "subject";
  
          $mail-&gt;MsgHTML($body);
  
          $address = "d@e.f";
          $mail-&gt;AddAddress($address, "halo:);
  
          if(!$mail-&gt;Send())
          {
            echo "Mailer Error: " . $mail-&gt;ErrorInfo;
          }
          else
          {
            echo "Message sent!";
          }
  </code></pre>
  
  <p>Despite following thoroughly the example from PHP Mailer wiki page, I somehow couldn't manage to send the email accordingly.</p>
  
  <p>This is the error message generated by the function:</p>
  
  <blockquote>
    <p>SMTP -> ERROR: Failed to connect to server: A connection attempt
    failed because the connected party did not properly respond after a
    period of time, or established connection failed because connected
    host has failed to respond. (10060) The following From address failed:
    a@b.c Mailer Error: The following From address failed: a@b.c</p>
  </blockquote>
  
  <p>Please advise me regarding this matter. Thank you.</p>