To use SMTP server for sending letters to Gmail accounts, follow the steps below:
If the e-mails are not sent after applying the previous changes, check whether PHP is configured with ssl socket transport support.
<?php
error_reporting(E_ALL ^ E_NOTICE);
ini_set("display_errors", "on");
$host = 'smtp.gmail.com';
$port = '465';
$tval ='30';
$test = fsockopen('ssl://' . $host, $port, $errno, $errstr, $tval);
if ($test == true){
print("OK");}
else
{
print $test;
}
?>
This code attemts to connect to the Gmail SMTP server.
8. Open this file using the link like http://www.you_domain.com/mail.php where www.you_domain.com is the store address.
If PHP is configured without ssl socket transport support, you will see the error like this:
Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?)
In that case contact your server administrator and ask them to enable ssl socket transport support on your server.
Questions & Feedback
Have any questions that weren't answered here? Need help with solving a problem in your online store? Want to report a bug in our software? Find out how to contact us.