Can't connect to SMTP server using PHP Mailer but can with Gmail?

0

I am getting the following error from PHP Mailer when running a script in my local PC:

SMTP -> ERROR: Failed to connect to server: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060)

This is my PHP Mailer main settings

$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->SMTPDebug  = 2;
$mail->Debugoutput = 'html';
$mail->Port       = 25;
$mail->Host = '<removed>';
$mail->SMTPAuth = true; // turn on SMTP authentication

It seems I can't connect to the SMTP server, however I am using the same credentials with my Gmail account (for Send mail as purposes) and it works fine.

The same script works when I test it to the actual SMTP server's publc_html folder but not in my local PC.

It seems the SMTP server is treating my local PC as an "outsider" but how come it allows Gmail to use my credentials? Me thinks, technically, Gmail and my PC is an "outsider".

Update: It seems the issue is actually in my local PC since I uploaded the same script in different remote server and it worked. Any ideas what could be the problem in my local PC? I already tried disabling the firewall.

IMB

Posted 2013-06-13T17:40:50.060

Reputation: 4 845

Answers

0

Your ISP May be blocking access to third-party SMTP Servers. I work customer support at a hosting company and we frequently get customers calling in who can't connect their mail clients to our SMTP Servers. A lot of ISPs block them and force their customers to use their own SMTP servers instead.

Ethan Sterling

Posted 2013-06-13T17:40:50.060

Reputation: 1