How to configure MailGun and Google Business Apps in CiviCRM
When configuring SMTP mail in CiiviCRM and you're using a secure port like 465, you need to prepend your hostname with ssl://, eg
ssl://smtp.mailgun.org or ssl://smtp.gmail.com
Add the other credentials, save and test and all should be good!