代码之家  ›  专栏  ›  技术社区  ›  VinoCoder

在laravel.env文件中配置发件人邮件地址

  •  1
  • VinoCoder  · 技术社区  · 6 年前

    我使用Laravel5.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
    

    然后在my mail.php中:

    'driver' => env('MAIL_DRIVER', 'smtp'),
    'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
    'port' => env('MAIL_PORT', 587),
    

    但是我不使用Gmail我想使用我的办公室电子邮件地址 (vino123@xxx.in) 域名是 邮箱.xxx.in 所以我不知道如何配置 主办 , 司机 港口 我的价值观 埃恩 邮件PHP 文件

    1 回复  |  直到 6 年前
        1
  •  1
  •   Yves Kipondo    6 年前

    为此,您必须询问与负责在接收电子邮件时发送的邮件服务器相关的所有信息,以及与负责管理该服务器的Office域相关的所有信息。

    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