skip to Main Content

I need to insert the email data that goes in the .env, directly in the code and not in the .env. However, I can’t figure out which file is getting these settings.

I am using the following line of code just like the laravel 10 documentation

$status = Password::sendResetLink(
  $request->only('email')
);

Can anyone tell me which file contains the .env settings to send this email?

2

Answers


  1. Simply testing email server using

    1. Mailtrap account login or create new account
      https://mailtrap.io/signin

    dashboard image.

    You can view the dashboard. Have you not viewed the project -> Create a new project. click setting button action have

    sample image

    Go Code Samples php select dropdown click and select laravel9+

    configuration copy image

    Right side copy button can copy the configuration and paste .env file

    configuration image

    Change this confgurations

    Login or Signup to reply.
  2. Usually, email config can be found at config/mail.php

    return [
        'default' => env('MAIL_MAILER', 'smtp'),
    
        'mailers' => [
            'smtp' => [
                'transport' => 'smtp',
                'url' => env('MAIL_URL'),
                'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
                'port' => env('MAIL_PORT', 587),
                'encryption' => env('MAIL_ENCRYPTION', 'tls'),
                'username' => env('MAIL_USERNAME'),
                'password' => env('MAIL_PASSWORD'),
                'timeout' => null,
                'local_domain' => env('MAIL_EHLO_DOMAIN'),
            ],
        ],
    
        'from' => [
            'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
            'name' => env('MAIL_FROM_NAME', 'Example'),
        ],
        
        // Other mail configuration settings
    ];
    

    Laravel email configs

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search