I have a laravel project uploaded on shared hosting via Go Daddy. I find that it's very 'moody, it often stops working.
Often i get time out errors and the erorr below
[2018-07-07n23:22:01] local.ERROR: Failed to authenticate on SMTP server with username "me#ne.org" using 2 possible authenticators {"exception":"[object] (Swift_TransportException(code: 0): Failed to authenticate on SMTP server with username \"x#x.x\" using 2 possible authenticators
I have tried using external smtp services such as mail chip or mailjet and also get errors.
MAIL_DRIVER=smtp
MAIL_HOST=smtp-mail.outlook.com
MAIL_PORT=587
MAIL_USERNAME=username
MAIL_PASSWORD=sdasda
MAIL_ENCRYPTION=TLS
I have even purchased outlook from Godaddy to try solve the issue and not rely on cpanel email.
Could this be becuase i have basic hosting and not business hosting?
Related
I have a free tier account on MailGun and I'm trying to configure the application to send the user a token to reset his password but I keep getting the following error in my browser console.
"Expected response code "220" but got code "421", with message "421 Server busy, too many connections".
This is how my .env file is configured
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME=postmaster#sandbox6xxxxxxxxxxxxxxx.mailgun.org
MAIL_PASSWORD=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
MAIL_ENCRYPTION=tls
Why are you using the smtp config? Laravel comes with a Mailgun driver built in. You should be setting your MAILER to mailgun and then configuring your mailgun domain, key, and email address.
See here: https://laravel.com/docs/9.x/mail#mailgun-driver
I'm trying to send emails from Laravel app that I have in production, but it's not working.
It gives me this error:
Connection could not be established with host smtp.googlemail.com :stream_socket_client(): unable to connect to ssl://smtp.googlemail.com:465 (Connection timed out)
But when I try to send email from localhost it works correctly.
my config mail
MAIL_DRIVER=smtp
MAIL_HOST=smtp.googlemail.com
MAIL_PORT=465
MAIL_USERNAME=*********
MAIL_PASSWORD=**********
MAIL_ENCRYPTION=ssl
also email is less secure:on
did you tried it out?
Using gmail smtp via Laravel: Connection could not be established with host smtp.gmail.com [Connection timed out #110]
Also make sure your if your gmail account has 2 factor authentication enabled or not.
If there is any two factor authentication enabled in your account then you can use App specific password from google account page.
There are lots of services you can use like Sendinblue, sendgrid etc.
I have migrated to new server from old server. There are quite changes in new server. Old server was using PHP 5.6 and phalcon 3.2 and new server is using PHP 7.3 & phalcon 3.4.4.
In old server email sending is working smoothly but in new server it's throwing the below error:
Swift_TransportException: Unable to connect with TLS encryption
Server Mail configuration in both sites are:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=myemail#gmail.com
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=tls
NOTE: Old site was on http and new site is on https
After 35 hours research and with the help of our great team finally found the solution :)
SMTP restriction was enabled on our server from WHM. After disabling the SMTP restriction the error was gone.
You can find this in WHM by searching SMTP and it will be available under security center. Disable it and this error will be no more.
In env file mentioned
MAIL_DRIVER=smtp
MAIL_HOST=email-smtp.us-east-1.amazonaws.com
MAIL_PORT=587
MAIL_USERNAME="XXXXXXXXXXXXXXXXXXXXXX"
MAIL_PASSWORD="XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
MAIL_ENCRYPTION=
SES_KEY="XXXXXXXXXXXXXXXXXXXXXXXXXXX"
SES_SECRET="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
SES_Region="US East (N. Virginia)"
Unable to send email in laravel by amazon ses ,all the credentials are correct but i keep on getting this error
The user credentials are correct but I still receive the following error:
Failed to authenticate on SMTP server with username
"email#example.com" using 2 possible authenticators
Hi I setup a contact form for my website with following configuration using Laravel framework
MAIL_DRIVER=smtp
MAIL_HOST=smtp.netregistry.net
MAIL_PORT=465
MAIL_USERNAME= example#domain.com
MAIL_PASSWORD=******
MAIL_ENCRYPTION=ssl
MAIL_FROM= example#domain.com
MAIL_NAME= name
the above config works fine in my localhost, however when I tried in live server it gives me error
Connection could not be established with host smtp.netregistry.net [Connection refused #111]
I tried to fix it by changing mail server to smtp.gmail.com and even tried port 25, 465, 587 for encryption such as ssl, tls, startTLS none of them worked.
So I contacted hosting providers and asked for help and after 12 days of my struggle to get them address my issue finally come up with
our cloud infrastructure does not allow external smtp connections from our hosting. This means that if you are sending emails from your website you will need to use localhost as the smtp host setting.
so now I tried to change my MAIL_HOST to localhost which gave me error
Connection could not be established with host smtp.netregistry.net [Connection refused #0]
and now they were suggesting something wrong with my script. Any suggestions
That is complete BS from your host. First thing, it's common for cloud systems to block OUTGOING SMTP, as it's a spam prevention measure, but your script is fine. Your host may be blocking everything but port 80, which means you can't connect to an SMTP host at all. You may be able to use localhost by not using SMTP at all, and use the builtin mailer(sendmail is common).
Change MAIL_DRIVER=smtp to MAIL_DRIVER=mail to use php's built in mailer. This may solve your problem, if not, then you should seek other hosting arrangements.