title: Send Email from PHP Script
body: <p>I wrote some code to send an email from my PHP script using PHPMailer. For some reason, the scripts isn't sending the messages.</p>
  
  <hr>
  
  <p><strong>Here Is My Code:</strong></p>
  
  <pre><code>&lt;?php
  require_once("PHPMailer/class.phpmailer.php");
  $mail=new PHPMailer();
  $mail-&gt;IsSMTP();
  $mail-&gt;SMTPAuth = true;
  $mail-&gt;Host = "ssl://smtp.gmail.com";
  $mail-&gt;Port = 465;
  $mail-&gt;Username = "admin@zbrowntechnology.com";
  $mail-&gt;Password = "PASSHERE";
  $mail-&gt;SetFrom = "admin@zbrowntechnology.com";
  $mail-&gt;AddAddress("zach@zbrowntechnology.com.com");
  $mail-&gt;Subject = "Confirm Web Lock Registration!";
  $mail-&gt;Body = "Please confirm your Web Lock Registration by clicking here!";
  $mail-&gt;WordWrap = 50;
  
  if(!$mail-&gt;Send())
  {
     echo 'Message was not sent.';
     echo 'Mailer error: ' . $mail-&gt;ErrorInfo;
  } else {
    echo "Message Sent!";
  }
  ?&gt;
  </code></pre>
  
  <p><strong>This Is The Error Echoed:</strong></p>
  
  <pre><code>SMTP Error: Could not connect to SMTP host. Message was not sent.Mailer error: SMTP Error: Could not connect to SMTP host.
  </code></pre>