title: SetForm Fatal error: Uncaught Error: Call to undefined method PHPMailer::SetForm()
body: <p>I'm doing form validation in jquery and using wamp server.But I'm getting these two errors 
  <code>Fatal error: Uncaught Error: Call to undefined method PHPMailer:: SetForm()</code>
  and <code>Error: Call to undefined method PHPMailer::SetForm()</code> I added PHPMailerAutoload.php also.An even set all localhost setting in <code>php.ini</code> and also in Apache <code>mail function</code> but still it throws an error.</p>
  
  <p>can anyone tell me what might be the problem here?
  Help will be appreciated.
  <a href="https://i.stack.imgur.com/DZSEr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DZSEr.png" alt="enter image description here"></a>
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;?php
   isset($_POST['name'],$_POST['email'],$_POST['phone'],$_POST['select'],$_POST['time'],$_POST['message']);
   require 'PHPMailer/PHPMailerAutoload.php';
   $mail = new PHPMailer();
   $mail -&gt; IsSmtp();
   $mail -&gt; SMTPDebug = 1;
   $mail -&gt; SMTPAuth = true;
   $mail -&gt; SMTPSecure = 'ssl';
   $mail -&gt; Host = 'smtp.gmail.com';
   $mail -&gt; Port = 465;
   $mail -&gt; IsHTML(true);
   $mail -&gt; Username = "your@gmail.com";
   $mail -&gt; Password = "123";
   $mail -&gt; SetForm("your@gmail.com");
   $mail -&gt; name = $name;
   $mail -&gt; body = $message;
   $mail -&gt; AddAddress = ($email);
   if (!$mail -&gt; Send()) {
    echo "mail not send";
   }
   else {
    echo "Your mail successfully sent....";
   }
  ?&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;form id="contact" method="post" action="form.php"&gt;
    &lt;div&gt;
     &lt;label for="contact_name"&gt;Name:&lt;/label&gt;
     &lt;input type="text" id="contact_name" name="name"&gt;&lt;/input&gt;
     &lt;span class="error"&gt;This field is required&lt;/span&gt;
    &lt;/div&gt;
    &lt;div&gt;
     &lt;label for="contact_email"&gt;Email:&lt;/label&gt;
     &lt;input type="email" id="contact_email" name="email"&gt;&lt;/input&gt;
     &lt;span class="error"&gt;A valid email address is required&lt;/span&gt;    
    &lt;/div&gt;
    &lt;div&gt;
     &lt;label for="contact_phone"&gt;Phone:&lt;/label&gt;
     &lt;input type="number" id="contact_phone" name="phone"&gt;&lt;/input&gt;
     &lt;span class="error"&gt;A valid Phone number is required&lt;/span&gt;    
    &lt;/div&gt;
    &lt;div&gt;
     &lt;label for="contact_select"&gt;Number of People&lt;/label&gt;
     &lt;select id="contact_select" name="select"&gt;
      &lt;option value=""&gt;select number of people&lt;/option&gt;
      &lt;option value="1"&gt;1&lt;/option&gt;
      &lt;option value="2"&gt;2&lt;/option&gt;
      &lt;option value="3"&gt;3&lt;/option&gt;
     &lt;/select&gt;
     &lt;span class="error"&gt;Select Number of Members&lt;/span&gt;   
    &lt;/div&gt;
    &lt;div&gt;
     &lt;label for="contact_time"&gt;Time&lt;/label&gt;
     &lt;select id="contact_time" name="time"&gt;
      &lt;option value=""&gt;select Time&lt;/option&gt;
      &lt;option value="00:00"&gt;00:00&lt;/option&gt;
      &lt;option value="00:15"&gt;00:15&lt;/option&gt;
     &lt;/select&gt;
     &lt;span class="error"&gt;Select Time option&lt;/span&gt;   
    &lt;/div&gt;     
    &lt;div&gt;
     &lt;label for="contact_message"&gt;Message:&lt;/label&gt;
     &lt;textarea id="contact_message" name="message"&gt;&lt;/textarea&gt;
     &lt;span class="error"&gt;This field is required&lt;/span&gt;            
    &lt;/div&gt;     
    &lt;div id="contact_submit"&gt;    
     &lt;input type="submit"&gt;&lt;/input&gt;
    &lt;/div&gt;
   &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>