I have to implement send mail functionality by using normal php not Smtp in cakephp 3.5.
I have to send html testingreport.ctp that I have put under Template/Email/html.
Below I have added controller and app.php code.
I am getting error Transport config "Mail" is missing.
What I am missing here to send the mail?
//app.php
'EmailTransport' => [
'default' => [
'className' => 'Mail',
// The following keys are used in SMTP transports
'host' => 'localhost',
'port' => 25,
'timeout' => 30,
'username' => 'user',
'password' => 'secret',
'client' => null,
'tls' => null,
'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
],
],
'Email' => [
'default' => [
'log' => true,
'transport' => 'Mail',
'emailFormat'=>'html',
'charset' => 'utf-8',
'headerCharset' => 'utf-8',
],
],
// controller
$email = new Email('default');
$email
->transport('testingreport','testingreport')
->from(['dkvastrakar18@gmail.com' => 'dkvastrakar18@gmail.com'])
->to('dkvastrakar18@gmail.com')
->subject('subjects')
->emailFormat('html')
->viewVars($testRequestDet)
->send('sendmail');