Warning: Missing argument 2 for wpdb::prepare(), called in /home/content/80/4361680/html/home/kerala-professional/wp-content/plugins/extended-categories-widget/libs/avh-db.php on line 62 and defined in /home/content/80/4361680/html/home/kerala-professional/wp-includes/wp-db.php on line 1222
Fixing SMTP connection error when connecting to Google Servers using PHP Scripts | www.friendzconnect.com

Fixing SMTP connection error when connecting to Google Servers using PHP Scripts

Google offers an excellent free email service to website owners where they can use custom domain names (yourchoice@yourdomain.com) to offer full-fledged Gmail styled email service with personal customization’s and branding to their users.

To use Google’s SMTP servers for sending emails, webmasters must configure there servers and application/scripts to use it instead of the default SMTP server configured on the system. While configuring the same for this drupal blog using SMTP Authentication Support Module, the following errors were shown resulting in repeated failures.

Warning: fsockopen() [function.fsockopen]:
unable to connect to ssl://smtp.gmail.com:465 (Connection timed out) in SMTP->Connect()

SMTP Error

To use Google’s SMTP services make sure you have following taken care off :

    • Using following settings to configure email sending.
Google Apps SMTP
    • Have OpenSSL support installed for PHP (if using PHP, otherwise framework you are using).
    • And finally the reason for errors above – proper permissions in your firewall. In my CentOS installation using the command below at terminal solved the issue:

      iptables -I OUTPUT -p tcp —dport 465 -j ACCEPT
      iptables -I OUTPUT -p tcp —dport 587 -j ACCEPT
Google SMTP Firewall

No related posts.

Leave a Comment

Switch to our mobile site