英文:
How to send email vis SMTP in my Laravel project
问题
我是 Laravel 的初学者。我现在正在使用 Laravel 开发一个网站,但遇到了一个困难的问题。我尝试解决这个问题,但无法解决。我已经实现了登录和注册逻辑,现在我需要重置密码,所以我将发送电子邮件链接给用户以重置密码。
我已经像这张图片一样设置了.env文件:
而且我收到了这个错误消息:
我该如何解决这个问题?(我已经将此网站托管在 cPanel 上。)
我已经多次尝试解决这个问题。
- 我看到了一篇文章来解决这个问题。有人告诉我需要将mail.xxx.com -> smtp.xxx.com更改,所以我这样做了,但没有起作用。
- 还有人告诉我这是DNS问题,所以我在php.ini文件中添加了'extension=php_openssl.dll',但它也没有起作用。
英文:
I am a beginner with Laravel. I am developing a Website with Laravel now and I face a difficult problem. I tried to solve this issue but I can't do. I already made login and registration logic and I need to reset the password so I am going to send email link to user to reset password.
I already set .env file like this image:
And I got this error message:
How can I solve this issue? (I've already hosted this website on cPanel.)
I tried several times to solve this issue.
- I saw a article to solve this issue. Someone told me I need to change mail.xxx.com -> smtp.xxx.com so I did but it doesn't work.
- And somebody told me this is DNS issue so I added 'extension=php_openssl.dll' in my php.ini file, but it doesn't work.
答案1
得分: 0
首先,尝试使用 mailtrap,如果你在使用GoDaddy主机,必须考虑以下事项。
我也曾面临相同的问题,当我在GoDaddy的cPanel上无法使用SMTP时,经过与支持团队的长时间交谈,他们告诉我由于他们那边的一些问题,它不适用于PHP 8.0及以上的版本,并建议我使用PHP版本7.4或更低的版本。
英文:
First, try using mailtrap and if you are using GoDaddy hosting you must consider the following.
I also faced the same problem when I could not use SMTP on GoDaddy's cPanel after a long conversation with the support team they told me it would not work on PHP 8.0^ because of some issue at their end and told me to use the PHP version 7.4 or less.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论