title: What goes in the username and password fields for PHPMailer?
body: <p>I'm trying to make one of those commonly known contact forms for a website, so that the user can directly send me an email from my website.</p>
  
  <p>Here is the code I have so far</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;html&gt;
  
  
  &lt;body&gt;
  
  
  &lt;?php
  require("PHPMailer_5.2.0/class.phpmailer.php");
  
  $mail = new PHPMailer();
  $mail-&gt;IsSMTP();
  $mail-&gt;Mailer = 'smtp';
  $mail-&gt;SMTPAuth = true;
  $mail-&gt;Host = 'smtp.gmail.com'; 
  $mail-&gt;Port = 465;
  $mail-&gt;SMTPSecure = 'ssl';
  
  
  $mail-&gt;Username = "username@example.com";
  $mail-&gt;Password = "password";
  
  //$mail-&gt;IsHTML(true); // if you are going to send HTML formatted emails
  
  $mail-&gt;From = "vikxsrk@gmail.com";
  $mail-&gt;FromName = "FROM NAME";
  
  $mail-&gt;addAddress("vik.kalkat@gmail.com","Vik Kalkat");
  
  $mail-&gt;Subject = "Testing PHPMailer with localhost";
  $mail-&gt;Body = "Hi,&lt;br /&gt;&lt;br /&gt;This system is working perfectly.";
  
  if(!$mail-&gt;Send())
      echo "Message was not sent &lt;br /&gt;PHPMailer Error: " . $mail-&gt;ErrorInfo;
  else
      echo "Message has been sent";
  
  ?&gt;
  
  
  &lt;/body&gt;
  
  
  &lt;/html&gt;
  </code></pre>
  
  <p>The error I am getting is </p>
  
  <pre class="lang-html prettyprint-override"><code>SMTP Error: Could not connect to SMTP host. Message was not sent 
  PHPMailer Error: SMTP Error: Could not connect to SMTP host.
  </code></pre>
  
  <p>I'm guessing this may be because my "Username" and "Password" parameters might be wrong since I'm unsure what username and password is suppose to go here.<br/>
  Is it the login information for the email account to which I want the emails to be sent to?</p>