Search code examples
smtpgmaillaravel-5.8

google smtp is not working on deployment but it works on local server


google smtp works fine on local server but after deployment it gives me that error

exception: "Swift_TransportException" file: "/home/sellective/public_html/sellective/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php" line: 269 message: "Connection could not be established with host smtp.googlemail.com"

my credentials are right . I've tried another account , another port and another encryption method also not working.


Solution

  • I stacked with similar problem few days ago. But I used PHPMailer to get gmail SMTP server connection. Maybe, your server belongs to goDaddy domains. PHPMailer wiki say this:

    Popular US hosting provider GoDaddy imposes very strict (to the point of becoming almost useless) constraints on sending an email. They block outbound SMTP to ports 25, 465 and 587 to all servers except their own.

    So, probably, you can't use google SMTP from your present server.

    Use WhoIs services to check who is Registrar of your hosting.