Connection error while sending email from host server
<p>I have created a web application in php . I am using PHP Mailer 5.20 class. it work fine when I use XAMPP server on my local server but when we  host it on a web-server and try to send a email the it return an error i show you the error below </p>

<blockquote>
  <p>SMTP -> ERROR: Failed to connect to server: Connection timed out (110)
  SMTP Error: Could not connect to SMTP host.</p>
</blockquote>

<p>I tried all configuration and check all but I receive the same error on the screen.</p>

<p>My PHP mailer class is below</p>

<pre><code>&lt;?php   require("PHPMailer_5.2.0/class.phpmailer.php");

function send_email($tomail,$message,$subject)
{
//$dbObj = new Database();
//$dbObj-&gt;connect_db();
$mail = new PHPMailer();

$mail-&gt;IsSMTP();
$mail-&gt;Host = "smtp.mail.yahoo.com";  // specify main and backup server
$mail-&gt;SMTPAuth = true;     // turn on SMTP authentication

/////////////////////////////////( USER NAME AND PASSWORD )///////////////////////////// 
 $email = "xyxxxxx@yahoo.in";
$mail-&gt;Username = $email;  // SMTP username
$mail-&gt;Password ="xxxxxx"; // SMTP password


$mail-&gt;From = $email;
$mail-&gt;AddAddress($tomail, $tomail);

// set word wrap to 50 characters
$mail-&gt;WordWrap = 50;
// set email format to HTML
$mail-&gt;IsHTML(true);

$mail-&gt;Subject = $subject;
$mail-&gt;Body    = $message;
$mail-&gt;AltBody =$message;
$mail-&gt;Subject =  $subject;

$mail-&gt;FromName ="xyz (Online Booking Info)";

if(!$mail-&gt;Send())
{ $rr= $mail-&gt;ErrorInfo;
    exit;

}


 }

?&gt;
</code></pre>

<p>Can some body tell me where am I wrong or miss configuration?</p>
