Here is the link that helps to configure stmp module with Gmail configuration and enables drupal site to send send email using Gmail Account
Also You can check the POST and Encrypted Protocol used by refereing this link
Here is the GitHub Link that helps me to get the list of countries at once
May it helps to you also
https://gist.github.com/Keeguon/2310008
Thanks