unable to work with PHPMailer with SMTP

iosoft

PC enthusiast since MS DOS 5
Skilled
I am writing a simple Mail application with PHPMailer class.
PHPMailer

Using PHPMailer we can send mails in 3 MODES -
  1. Direct mail (less secure and may end up in Junk Box )
  2. using proper SMTP Server (most secure and BEST)
  3. using Sendmail (good but NOT BEST)

Problem -
I am unable to send any mails using this secure SMTP method :huh:


Here is the CODE Block -
PHP:
include_once('./email/class.phpmailer.php');
include_once('./email/class.smtp.php');

$mail = new PHPMailer();
$mail->SetLanguage('en', './email/language/');

$mail->IsSMTP();

$mail->Host     = "mail.gigahertz.net.in";
$mail->SMTPKeepAlive = true;

//$mail->Mailer   = "smtp";
$mail->SMTPDebug = 2;

$mail->Username = "testing@gigahertz.net.in";	// your SMTP username
$mail->Password = "testing";				// your SMTP password
$mail->SMTPAuth = true;   				// turn on SMTP authentication -- generally needed for most SMTP servers
$mail->From     = "testing@gigahertz.net.in"; $mail->FromName = "GHz";
$mail->AddAddress("iosoft@gmail.com");
$mail->Subject  = "An HTML Message";
$mail->Body     = "Test";
if(!$mail->Send())
        echo "Error:".$mail->ErrorInfo;
else 
        echo "Okay";

The ERROR says -
Warning: fsockopen() [function.fsockopen]: unable to connect to mail.gigahertz.net.in:25 (Connection timed out) in /home/gigahert/public_html/includes/phpmailer/class.smtp.php on line 105
SMTP -> ERROR : Failed to connect to server : Connection timed out (110) Error:SMTP Error: Could not connect to SMTP host.

NOTE
I do have fsockopen() feature and the mail server is running on Port 25.
and that testing@gigahertz.net.in (pass:testing) is Valid a/c but Temporary.
Please help me out
 
Back
Top