title: Email function is not sending : Hosting server godaddy
body: <p>I'm created email function in php, my files and all hosting is godaddy.
  when ever i'm submitting my form mail is not sent it is going to if condition inside showing error message --- mail not sent successfully!.please some one help me..
  my Php function code is blow:</p>
  
  <pre><code>&lt;?php
  include("/home/mu3c3ezzh1cs/public_html/mailer/class.phpmailer.php");
   if(isset($_POST['submit'])){
    $name         = $_POST['name'];
    $email        = $_POST['email'];
    $mobile       = $_POST['phone'];
    $location     = $_POST['location'];
    $decs         = $_POST['desc'];
    $contact_name ="Please check the Requirement";
    $message = "";
    $subject_thankyou = "Enquiry Acknowledgement from abc.";
    $message_thankyou = "&lt;p&gt;Dear ".$name.",&lt;/p&gt;&lt;p&gt;We just received your enquiry. We will get back to you as soon as possible. Thank you for the interest shown on .&lt;/p&gt;&lt;p&gt;Best Regards&lt;br /&gt; abc&lt;br/&gt; Web :&lt;a href='http://abc.in'&gt;www.abc.in&lt;/a&gt;&lt;/p&gt;";
    $mail = new PHPMailer;
    $mail-&gt;IsSMTP(); // enable SMTP
    $mail-&gt;SMTPDebug = 0;  // debugging: 1 = errors and messages, 2 = messages only
    $mail-&gt;SMTPAuth  = true;  // authentication enabled
    $mail-&gt;SMTPSecure = 'ssl';
    $mail-&gt;Host     = "hostname";/*Specify main and backup SMTP servers*/
    $mail-&gt;Port     = 465;
    $mail-&gt;SMTPAuth = true;/*Enable SMTP authentication*/
    $mail-&gt;Username = "username";/*SMTP username*/
    $mail-&gt;Password = "password";/*SMTP password*/
    $mail-&gt;setFrom('info@abd.com', 'abc');
    $mail-&gt;addAddress($email , $name);
    $mail-&gt;isHTML(true);
    $mail-&gt;Subject = $subject_thankyou;
    $mail-&gt;Body    = $message_thankyou;
    $mail-&gt;AltBody = $subject_thankyou;
    $mail-&gt;send();
    $subject ='Enquiry for abc'; 
  
    $email_header ='&lt;html style="color: rgb(34, 34, 34); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); max-width: 575px; line-height: 18px; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;
                      &lt;head&gt;
                        &lt;meta name="viewport" content="width=device-width" /&gt;
                        &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"&gt;
                    &lt;/head&gt;
                    &lt;body bgcolor="#FFFFFF" text="#000000"  style="color: rgb(34, 34, 34); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); max-width: 575px; line-height: 18px; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;
                    &lt;table style="font-family:Helvetica,Arial,sans-serif;background:#EFEDED;padding:0 0 10px 0;" cellpadding="0" cellspacing="0" bgcolor="#EFEDED" border="0" width="100%"&gt;
                    &lt;tbody&gt;
                    &lt;tr&gt;
                    &lt;td align="center"&gt;
                    &lt;table width="96%" cellpadding="0" cellspacing="0"border="0"&gt;
                    &lt;tbody&gt;              
                    &lt;tr&gt;
                    &lt;td style="border-top:5px solid #1e96d3;background:#fff;margin:0; padding:20px; border-spacing:0px;"&gt;';
  
    $email_footer = '&lt;/td&gt;
                      &lt;/tr&gt;               
                      &lt;/tbody&gt;
                      &lt;/table&gt;
                      &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;/tbody&gt;
                      &lt;/table&gt;
                      &lt;/td&gt;
                      &lt;/tr&gt;              
                      &lt;/tbody&gt;
                      &lt;/table&gt;
                      &lt;/body&gt;
                      &lt;/html&gt;';
  
      $body = $email_header.
          '&lt;table width="100%" cellpadding="0" cellspacing="0"&gt;
                &lt;tr&gt;
                &lt;td style="margin:0; padding:0px 0px 15px 0px; border-spacing:0px;"&gt;
                &lt;p style="font-size:14px; color: rgb(0, 0, 0); font-family: Arial, Helvetica, sans-serif; font-weight: bold; line-height: 1.5em; margin: 0px; padding: 0.4em; text-align: left;"&gt;
                '.$subject.'
                &lt;/p&gt;
                &lt;/td&gt;
                &lt;/tr&gt;
                &lt;tr&gt;
                &lt;td style="margin:0; padding:0px 0px 15px 0px; border-spacing:0px;"&gt;
                &lt;p style="color:#000; font-size:13px; margin:0; font-family:Arial, Helvetica,sans-serif;"&gt;
                &lt;strong&gt;
                '.$contact_name.',
                &lt;/strong&gt;
                &lt;br&gt;
                &lt;/p&gt;
                &lt;/td&gt;
                &lt;/tr&gt;                     
                &lt;tr&gt;
                &lt;td style="margin:0; padding:0 0 5px 0;"&gt;
                &lt;p style="font-size:13px; background-color: rgb(234, 234, 234); color: rgb(0, 0, 0); font-family: Arial, Helvetica, sans-serif; font-weight: bold; line-height: 1.5em; margin: 0px; padding: 0.4em; text-align: left;"&gt;
                Details:
                &lt;/p&gt;
                &lt;/td&gt;
                &lt;/tr&gt;
                &lt;tr&gt;
                &lt;td style="margin:0; padding:0px 0px 15px 0px; border-spacing:0px;"&gt;
                &lt;table style="font-family:Helvetica,Arial,sans-serif; font-size:12px; font-weight:bold; margin-top:10px; width:100%"&gt;
                &lt;tbody&gt;
                &lt;tr&gt;
                &lt;td style="width:120px; padding:4px 0;"&gt;
                Name
                &lt;/td&gt;  
                &lt;td style="padding-right:10px;"&gt;
                :
                &lt;/td&gt;
                &lt;td style="font-weight:normal;"&gt;
                '.$name.'
                &lt;/td&gt;
                &lt;/tr&gt;
                &lt;tr&gt;
                &lt;td style="padding:4px 0;"&gt;
                Phone Number
                &lt;/td&gt;
                &lt;td&gt;
                :
                &lt;/td&gt;
                &lt;td style="font-weight:normal;"&gt;
                '.$mobile.'
                &lt;/td&gt;
                &lt;/tr&gt;
          &lt;tr&gt;
                &lt;td style="padding:4px 0;"&gt;
                Email
                &lt;/td&gt;
                &lt;td&gt;
                :
                &lt;/td&gt;
                &lt;td style="font-weight:normal;"&gt;
                '.$email.'
                &lt;/td&gt;
                &lt;/tr&gt;
          &lt;tr&gt;
                &lt;td style="padding:4px 0;"&gt;
                Location
                &lt;/td&gt;
                &lt;td&gt;
                :
                &lt;/td&gt;
                &lt;td style="font-weight:normal;"&gt;
                '.$location.'
                &lt;/td&gt;
                &lt;/tr&gt;
                &lt;tr&gt;
                &lt;td style="padding:4px 0;"&gt;
                Description
                &lt;/td&gt;
                &lt;td&gt;
                :
                &lt;/td&gt;
                &lt;td style="font-weight:normal;"&gt;
                '.$decs.'
                &lt;/td&gt;
                &lt;/tr&gt;
                &lt;/tbody&gt;
                &lt;/table&gt;
                &lt;/td&gt;
                &lt;/tr&gt;
                &lt;/table&gt;'
                .$email_footer;
      $message .= $body;
      $mail = new PHPMailer;
      $mail-&gt;IsSMTP(); // enable SMTP
      $mail-&gt;SMTPDebug = 0;  // debugging: 1 = errors and messages, 2 = messages only
      $mail-&gt;SMTPAuth = true;
      $mail-&gt;SMTPSecure= false;  
      $mail-&gt;Host     = "hostname";
      $mail-&gt;Port     = 465;
      $mail-&gt;SMTPAuth = true;/*Enable SMTP authentication*/
      $mail-&gt;Username = "username";
      $mail-&gt;Password = "password";
      $mail-&gt;setFrom('info@abc.com', $name);
      $mail-&gt;addAddress('abc@gmail.com' , 'abc');
      $mail-&gt;isHTML(true);
  
    if(!$mail-&gt;Send()) {
              ?&gt;
                    &lt;script type="text/javascript"&gt;
                     window.alert("mail not sent successfully!");
                    // window.location.href="thanks.php";
                  &lt;/script&gt;
                   &lt;?php
            }
             else{
           ?&gt;
                &lt;script type="text/javascript"&gt;
                 window.location.href="thanks.php";
              &lt;/script&gt;
               &lt;?php
         }
       }
  ?&gt;
  </code></pre>