Gmail Smtp Connection Problem

Hello all,

I installed my Cs-Cart to my new domain and tried to connect my email via SMTP. I am using Google Apps Gmail service for my domain. However I failed to use it and every time I get same error.

ErrorMessage could not be sent.

Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

What I tried up to now:

* I double checked every details on the email settings page, port, ssl, password, username etc.

*I removed 2FA authentication on gmail and also I turned on access for less secured apps on gmail security settings

*I updated the phpmailer folder with the newest one. 5.2.26

I checked most web and could not find the exact working solution. All your help will be much appreciated.

Most probably your firewall is blocking the port. You have to open the port.

Hello, could you please be more specific ? Can I do it on Cpanel ?

Most probably your firewall is blocking the port. You have to open the port.

Hello urbanp

Please try version 5.2.9 (The latest version is 6.0.5 ! not 5.2.26) see https://github.com/PHPMailer/PHPMailer

I had the same problem and it solved me.

Best regards

Robert.

Hello urbanp

Please try version 5.2.9 (The latest version is 6.0.5 ! not 5.2.26) see https://github.com/PHPMailer/PHPMailer

I had the same problem and it solved me.

Best regards

Robert.

Hello you mean 5.2.19 ? because I don't think there is 5.2.9 version.

Hello

Please try download newest version 6.0.5. And see if there will be an error.

Best regards

Robert.

Hello,

It did not worked.

Also there is significant change between v5 and v6. I don't think version 6 will work with current Cs-Cart ?

I tried most versions of phpmailer but still same problem :/

Hello

Please try download newest version 6.0.5. And see if there will be an error.

Best regards

Robert.

Hello.

Please try my package and write if it works for you.

Best regards

Robert.

phpmailer.tar.gz

Hello,

Your version is 5.2.9 (sorry I find it now) from Sep 26, 2014. I now uploaded this version and still getting same error.

Thank you for your effort but I think the problem caused because of something else. In older versions of Cs-cart I did not experience it but now I am using latest version of Cs-cart, and experience this.

ErrorMessage could not be sent.

Mailer Error: SMTP connect() failed.

Hello, could you please be more specific ? Can I do it on Cpanel ?

If you're using WHM and csf firewall, it's Home »Plugins »ConfigServer Security & Firewall

Then choose firewall configuration and add port 465 there. If you're unsure, just ask your host :)

If you're using WHM and csf firewall, it's Home »Plugins »ConfigServer Security & Firewall

Then choose firewall configuration and add port 465 there. If you're unsure, just ask your host :)

I talked with the hosting support, they port is running and it was opened already. Thank you for your answer anyway.

From the original error message, you shouldn't be specifying an SMTP host using an http protocol (drop the https:// part). Make sure you're just using the hostname and let the system manage the protocol properly. If you need to add a special port then do so using hostname:port type of syntax. Generally the system will determine the protocol when it tries to open the port. I.e. SMTP protocol will tell it what it expects.

From the original error message, you shouldn't be specifying an SMTP host using an http protocol (drop the https:// part). Make sure you're just using the hostname and let the system manage the protocol properly. If you need to add a special port then do so using hostname:port type of syntax. Generally the system will determine the protocol when it tries to open the port. I.e. SMTP protocol will tell it what it expects.

Hello,

I use exact "smtp.gmail.com:465" in smtp host section.

SSL encryption with smtp authentication on.

Please make a file called something like mailtest.php with the following content, upload it to your domain, visit the file from your browser, and let us know what it says?

$host = ‘smtp.gmail.com’;
$port = ‘465’;
$tval =‘30’;

$test = fsockopen(‘ssl://’ . $host, $port, $errno, $errstr, $tval);
if ($test == true){
print(“OK”);}
else
{
print $test;
}
?>

It should say OK.

Please make a file called something like mailtest.php with the following content, upload it to your domain, visit the file from your browser, and let us know what it says?

$host = ‘smtp.gmail.com’;
$port = ‘465’;
$tval =‘30’;

$test = fsockopen(‘ssl://’ . $host, $port, $errno, $errstr, $tval);
if ($test == true){
print(“OK”);}
else
{
print $test;
}
?>

It should say OK.

Returns OK.

Good. And you have the following settings?

smtp.gmail.com:465

Use Encrypted Connection: SSL

Use SMTP authentication: Checked

Good. And you have the following settings?

smtp.gmail.com:465

Use Encrypted Connection: SSL

Use SMTP authentication: Checked

All correct. I added a screenshot of the settings page.

https://unsee.cc/5d21ce60/

Hi

i have the same Problem kindly let me know how to solve it, i did exactly what here send buy i am getting still the same error,

kindly help me to solve it

Error Message could not be sent.
Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

thanks

Hi

i have the same Problem kindly let me know how to solve it, i did exactly what here send buy i am getting still the same error,

kindly help me to solve it

Error Message could not be sent.
Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

thanks

Does the mailtest.php file I posted return OK?

Does the mailtest.php file I posted return OK?

Hi

Thanks for the reply, yes the mailtest.php is OK

but dont no what is the exactly problem

Firewall had change the Port 465

SMTP settings in also fine!

Thanks