I want to send an email with CakePHP 4. In app_local.php i have following entry
'EmailTransport' => [
'default' => [
'host' => 'smtp.XXX.de',
'port' => 25,
'username' => null,
'password' => null,
'client' => null,
'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
],
],
If i try to send an email with following Code
$mailer = new Mailer('default');
$mailer->setFrom(['willi@test.de' => 'Willi'])
->setTo('wutz@test.de')
->setSubject('About')
->deliver('blablabla');
i got following ErrorMessage
Could not send email: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
Why is Cake trying to use Mailserver at localhost??? Where is my error? ;-)