Created
November 11, 2014 17:47
-
-
Save pupi1985/67aff930780d8848d0b9 to your computer and use it in GitHub Desktop.
Gmail SMTP email test using fsockopen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doctype() { | |
if (qa_get_logged_in_handle() === 'admin') { | |
echo "Starting tests...<br>\n"; | |
if(!fsockopen("www.google.com", 80, &$errno, &$errstr, 15)) | |
echo "www.google.com 80 - $errstr ($errno)<br>\n"; | |
else | |
echo "www.google.com 80 - ok<br>\n"; | |
if(!fsockopen("smtp.gmail.com", 465, &$errno, &$errstr, 15)) | |
echo "smtp.gmail.com 465 - $errstr ($errno)<br>\n"; | |
else | |
echo "smtp.gmail.com 465 - ok<br>\n"; | |
if(!fsockopen("smtp.gmail.com", 587, &$errno, &$errstr, 15)) | |
echo "smtp.gmail.com 587 - $errstr ($errno)<br>\n"; | |
else | |
echo "smtp.gmail.com 587 - ok<br>\n"; | |
echo "Tests finished...<br>\n"; | |
echo phpinfo(); | |
exit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment