smtp settings error, what's wrong? #1348

Closed
opened 2026-02-05 00:40:10 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @nestle49 on GitHub (Sep 10, 2019).

When I try confirmed email, get message:

Email confirmation required but the system could not send the email. Contact the admin to ensure email is set up correctly.

.env file
`APP_KEY=***
APP_DEBUG=true
APP_URL=***

Database details

DB_HOST=localhost
DB_DATABASE=***
DB_USERNAME=***
DB_PASSWORD=***

Mail sending options

MAIL_FROM_ADDRESS=nestle9412@gmail.com
MAIL_FROM_NAME="Confirm E-mail adress"

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=nestle9412@gmail.com
MAIL_PASSWORD=*********
MAIL_ENCRYPTION=null`

Mail encryptin also tried with tls/ssl

Config mail.php

`return [

// Mail driver to use.
// Options: smtp, mail, sendmail, log
'driver' => env('MAIL_DRIVER', 'smtp'),

// SMTP host address
'host' => env('MAIL_HOST', 'smtp.gmail.com'),

// SMTP host port
'port' => env('MAIL_PORT', 587),

// Global "From" address & name
'from' => [
    'address' => env('MAIL_FROM', 'nestle9412@gmail.com'),
    'name' => env('MAIL_FROM_NAME','Wiki ITS')
],

// Email encryption protocol
'encryption' => env('MAIL_ENCRYPTION', 'tls'),

// SMTP server username
'username' => env('nestle9412@gmail.com'),

// SMTP server password
'password' => env('***'),

'pretend' => false,

// Sendmail application path
// 'sendmail' => '/usr/sbin/sendmail -bs',

// Email markdown configuration
'markdown' => [
    'theme' => 'default',
    'paths' => [
        resource_path('views/vendor/mail'),
    ],
],

];`

What's wrong?

Originally created by @nestle49 on GitHub (Sep 10, 2019). When I try confirmed email, get message: > Email confirmation required but the system could not send the email. Contact the admin to ensure email is set up correctly. .env file `APP_KEY=*** APP_DEBUG=true APP_URL=*** # Database details DB_HOST=localhost DB_DATABASE=*** DB_USERNAME=*** DB_PASSWORD=*** # Mail sending options MAIL_FROM_ADDRESS=nestle9412@gmail.com MAIL_FROM_NAME="Confirm E-mail adress" MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 MAIL_USERNAME=nestle9412@gmail.com MAIL_PASSWORD=********* MAIL_ENCRYPTION=null` Mail encryptin also tried with tls/ssl Config mail.php `return [ // Mail driver to use. // Options: smtp, mail, sendmail, log 'driver' => env('MAIL_DRIVER', 'smtp'), // SMTP host address 'host' => env('MAIL_HOST', 'smtp.gmail.com'), // SMTP host port 'port' => env('MAIL_PORT', 587), // Global "From" address & name 'from' => [ 'address' => env('MAIL_FROM', 'nestle9412@gmail.com'), 'name' => env('MAIL_FROM_NAME','Wiki ITS') ], // Email encryption protocol 'encryption' => env('MAIL_ENCRYPTION', 'tls'), // SMTP server username 'username' => env('nestle9412@gmail.com'), // SMTP server password 'password' => env('***'), 'pretend' => false, // Sendmail application path // 'sendmail' => '/usr/sbin/sendmail -bs', // Email markdown configuration 'markdown' => [ 'theme' => 'default', 'paths' => [ resource_path('views/vendor/mail'), ], ], ];` What's wrong?
OVERLORD added the 🐕 Support label 2026-02-05 00:40:10 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Sep 15, 2019):

Hi @nestle49,
Sorry to hear you are having problems.

The edits made in the app/Config/mail.php file would cause the username and password values to effectively be null due to use of the env() function without defined values.

None of the app/Config files should be touched. You should only need to alter your .env file.

Additionally, Have you used Google's SMTP for similar purposes before on your account? I know there's a few caveats, like needing to generate an app password if you have 2FA enabled. The first few steps on this guide seems to have some good details on enabled gmail SMTP use:
https://support.cloudways.com/configure-gmail-smtp/

@ssddanbrown commented on GitHub (Sep 15, 2019): Hi @nestle49, Sorry to hear you are having problems. The edits made in the `app/Config/mail.php` file would cause the username and password values to effectively be `null` due to use of the `env()` function without defined values. None of the `app/Config` files should be touched. You should only need to alter your `.env` file. Additionally, Have you used Google's SMTP for similar purposes before on your account? I know there's a few caveats, like needing to generate an app password if you have 2FA enabled. The first few steps on this guide seems to have some good details on enabled gmail SMTP use: https://support.cloudways.com/configure-gmail-smtp/
Author
Owner

@ssddanbrown commented on GitHub (Apr 8, 2020):

Since the last comment on this issue is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one.

@ssddanbrown commented on GitHub (Apr 8, 2020): Since the last comment on this issue is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1348