title: phpMailer not working after being hosted
body: <p>phpMailer script works fine on localhost but once uploaded on 000webhost.com it gives me this error message:</p>
  
  <pre><code>SMTP -&gt; ERROR: Failed to connect to server: Connection timed out (110) 
  The following From address failed: abc@gmail.com : Called Mail() without being connected         Mailer Error: The following From address failed: abc@gmail.com : Called Mail() without being    connected
  </code></pre>
  
  <p>here is my script:</p>
  
  <pre><code>&lt;?php
  require_once('class.phpmailer.php');
  //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php          if not already loaded
  
  ////////extracting form data from POST/////////
  
  $course = $_REQUEST["Course__2"];
  $receiver_name = $_REQUEST["Name__1"];
  $receiver_email = $_REQUEST["Email__3"];
   /////////////////
  
  $mail             = new PHPMailer();
  
  $body             = "Hi .";
  
  $mail-&gt;IsSMTP(); // telling the class to use SMTP
  $mail-&gt;Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
  $mail-&gt;Port       = 587;                   // set the SMTP port for the GMAIL server
  $mail-&gt;SMTPAuth   = true;                  // enable SMTP authentication
  $mail-&gt;Username   = "abc@gmail.com";  // GMAIL username
  $mail-&gt;Password   = "00000000";            // GMAIL password
  $mail-&gt;SMTPSecure = "tls";                 // sets the prefix to the servier
  
  
  $mail-&gt;SMTPDebug  = 1;                     // enables SMTP debug information (for testing)
                                         // 1 = errors and messages
                                         // 2 = messages only
  
  
  
  
  $mail-&gt;SetFrom('abc@gmail.com', ' Global'); //sender's     email address
  
  $mail-&gt;AddReplyTo("abc@gmail.com","Global"); //A reply to address
  
  $mail-&gt;Subject    = "10% Off Voucher";
  
  $mail-&gt;AltBody    = "To view the message, please use an HTML compatible email viewer!";     // optional, comment out and test
  
  $mail-&gt;MsgHTML($body);
  
  $address = $receiver_email; //receiver's address
  $mail-&gt;AddAddress($address, $receiver_name); //name of receiver
  
  if(!$mail-&gt;Send()) {
    echo "Mailer Error: " . $mail-&gt;ErrorInfo;
  } else {
    echo "Message sent!";
  }
  
  
  
  ?&gt;
  </code></pre>
  
  <p>Is it a problem with the hosting provider or something wrong with my code?</p>