Can't send mail via mail Setting 2024

I looked this up and there was a lot of talk around this.
I am using nextcloud-aio
Basic settings trying to set up smtp with gmail
I get

A problem occurred while sending the email. Please revise your settings. (Error: Email could not be sent. Check your mail server log)

I looked into these two posts
here
and here

I added the recommended fix to my config.php like this

## I added these lines
  'mail_smtpstreamoptions' => 
  array (
    'ssl' => 
    array (
      'allow_self_signed' => true,
      'verify_peer' => false,
    ),
  ),
## this is the end of the added lines to the config.php

  'mail_smtphost' => 'smtp.gmail.com',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'my-mail',
  'mail_domain' => 'gmail.com',
  'mail_smtpport' => '587',
);

Any suggestinos?

Did you allow sending mails by unsecure email-clients in your Gmail-account settings?

Maybe you will find a solution there:

1 Like