“Connection could not be established with host smtp.gmail.com”. Symfony. Swiftmailer
问题 I got exception: Connection could not be established with host smtp.gmail.com Same exception in old project Symfony2.8 and newest Symfony3. I can ping smtp.gmail.com . 回答1: The Avast Antivirus was guilty. 回答2: In Google "Account settings" enable "Access for less secured apps" by setting it to "Allow". Mailer host is your localhost or 127.0.0.1. It's not smtp.google.com 回答3: I'm using this configuration for my localhost application parameters: mailer_transport: gmail mailer_host: smtp.gmail