laravel-5 - 在 laravel .env 文件中配置发件人邮件地址
问题描述
我使用 laravel 5.6 应用程序来开发项目。在那个项目中,我必须向用户发送邮件。所以我想在文件中配置发件人邮件env
地址mail.php
。
如果它是用于 gmail 的,那么我将在 env 文件中使用如下所示:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.io
MAIL_PORT=587
MAIL_USERNAME=vino@gmail.com
MAIL_PASSWORD=feaeda91d
MAIL_ENCRYPTION=TLS
然后在我的mail.php中:
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
但我没有使用 gmails 我想使用我的办公室电子邮件地址(vino123@xxx.in)并且域名是mail.xxx.in所以我不知道如何在我的和文件中配置主机、驱动程序和端口值env
mail.php
解决方案
为此,您必须向负责管理该服务器的人员询问您办公室域中负责在接收电子邮件时发送的邮件服务器的所有相关信息。
MAIL_DRIVER=smtp
// The server IP address or domaine name of the mail server
MAIL_HOST=your_ofice_domaine_name.in
// Port on which the server is receiving email
MAIL_PORT=587
// The username with which to make authentification on the mail server
MAIL_USERNAME=johndoe
// The password of the user
MAIL_PASSWORD=feaeda91d
// If the server is using encryption you can set it here
MAIL_ENCRYPTION=TLS
推荐阅读
- java - 使用 Java8 将两个 Map 组合成一个对象列表
- python - 在 Python 中返回字符串日期的日期
- perl - 在 perl 中出现“printf at ... 中缺少参数”?
- php - SQLSTATE [42S22]:未找到列:1054 未知列 PhP PDO MariaDB10
- python - 带有 open() 函数的“类型错误:'int' 和 'str' 的实例之间不支持 '>'”
- git - 恢复我从 git 阶段删除的文件?
- java - 无法从 bin 文件夹运行 java
- c# - 按 Enter 时阻止程序崩溃
- php - php准备好的语句返回空表
- verilog - 这段代码出现意外行为,这是怎么回事?