i wish to use gmail smtp to send user information to the registered email.
The code that i am using is working fine in my localhost, but when i changed into shared ho
there is update for test script in newer php version:
<?php
$fp = fsockopen("www.google.com", 80, $errno, $errstr, 10); // work fine
if (!$fp)
echo "www.google.com - $errstr ($errno)<br>\n";
else
echo "www.google.com - ok<br>\n";
$fp = fsockopen("smtp.gmail.com", 465, $errno, $errstr, 10); // NOT work
if (!$fp)
echo "smtp.gmail.com 465 - $errstr ($errno)<br>\n";
else
echo "smtp.gmail.com 465 - ok<br>\n";
$fp = fsockopen("smtp.gmail.com", 587, $errno, $errstr, 10); // NOT work
if (!$fp)
echo "smtp.gmail.com 587 - $errstr ($errno)<br>\n";
else
echo "smtp.gmail.com 587 - ok<br>\n";
?>
Looks like ur ssl port in shared hosting is close, use this code to check if it is open.
$fp = fsockopen("www.google.com", 80, &$errno, &$errstr, 10); // work fine
if (!$fp)
echo "www.google.com - $errstr ($errno)<br>\n";
else
echo "www.google.com - ok<br>\n";
$fp = fsockopen("smtp.gmail.com", 465, &$errno, &$errstr, 10); // NOT work
if (!$fp)
echo "smtp.gmail.com 465 - $errstr ($errno)<br>\n";
else
echo "smtp.gmail.com 465 - ok<br>\n";
$fp = fsockopen("smtp.gmail.com", 587, &$errno, &$errstr, 10); // NOT work
if (!$fp)
echo "smtp.gmail.com 587 - $errstr ($errno)<br>\n";
else
echo "smtp.gmail.com 587 - ok<br>\n";