简体   繁体   中英

Why does Laravel mail not work on a live server?

I have a hosting on Godaddy. I have written an email app. It works properly on localhost. I can't run on hosting. When you enter the smtp settings of different servers, it still does not work. I also read the following topics.

Why mail laravel not working on the staging server?

Using Laravel, SMTP Mail not Working in Live Server

https://laracasts.com/discuss/channels/laravel/laravel-sending-mail-not-working-on-production-server

Connection could not be established with host mailtrap.io [php_network_getaddresses: getaddrinfo failed: No such host is known. #0]

MAIL_DRIVER=smtp
MAIL_HOST=mail.domain.org
MAIL_PORT=587
MAIL_USERNAME=user@domain.org
MAIL_PASSWORD=password
MAIL_ENCRYPTION=null

Settings running on my localhost.

Connection could not be established with host smtp.domain.org [php_network_getaddresses: getaddrinfo failed: Name or service not known #0]

Godaddy smtp settings when I give 500 error. It does not generate any error.log

Also

MAIL_DRIVER=mail

and

MAIL_DRIVER=sendmail

I tried them by looking at other links. but I couldn't find a solution.

Unfortunately, you may not be able to use an external mail relay with shared hosting. https://www.godaddy.com/help/send-form-mail-using-an-smtp-relay-server-953

These should be the GoDaddy localhost settings:

### MAIL SERVER
MAIL_DRIVER=mail
MAIL_HOST=localhost
MAIL_PORT=25
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=user@domain.com
MAIL_FROM_NAME="Your Company"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM