title: PHPMailer is not working on godaddy server
body: <p>I have developed a site in PHP and added a PHPMailer function for my contact us page but the mailer functionality is not working. Contacted with support team but they didn't help me tried a lot with that.</p>
  
  <pre><code>&lt;?php
      if(isset($_POST['submit_contact']))  
      {
         require 'PHPMailer/PHPMailerAutoload.php';
         $to = "gmail@gmail.com";
         $name = $_POST['uname'];
         $email = $_POST['email'];
         $phone = $_POST['phonenumber'];
         $companyname = $_POST['companyname'];
         $country = $_POST['country2'];
         $mail = new PHPMailer();
         $mail-&gt;isSMTP();                                      
         $mail-&gt;SMTPDebug = 2;  
         $mail-&gt;SMTPAuth = true;
         $mail-&gt;SMTPSecure = 'ssl';
         $mail-&gt;Host = "relay-hosting.secureserver.net"; 
         $mail-&gt;Port = 465;
         $mail-&gt;IsHTML(true);                                     
         $mail-&gt;Username = "xxxx@gmail.com";                 
         $mail-&gt;Password = "PASSword1@3";   
         $message = array();    
         $message[] = 'Name  :  '.trim($name).' ';        
         $message[]='Phone  :  '.trim($phone).' ';   
         $message[]='Email  :  '.trim($email).' '; 
         $message[]='Company Name  :  '.trim($companyname).' ';    
         $message[]='Country  :  '.trim($country).' ';    
         $message = implode('&lt;br/&gt;', $message);           
         $mail-&gt;SetFrom($email);
         $mail-&gt;Subject = 'Here is the subject';
         $mail-&gt;Body = $message;
         $mail-&gt;AddAddress($to); 
         if(!$mail-&gt;send()) {
              $msg = "Error while sending email";
              $msgclass = 'bg-danger';
              header("Location: /");
              die();    
         } 
         else {
            $msg = 'A mail with recovery instruction has sent to your email.';
            $msgclass = 'bg-success';
         }     
      }
  ?&gt;
  </code></pre>