我的Cakephp 3中的电子邮件传输有问题。我将默认电子邮件传输设置为Debug,而Cakephp 3表示我没有电子邮件传输。
我很想更改电子邮件传输的名称,className并将其包含在Mailer中,但是什么也没有发生。
这是我在App.php中的代码
'EmailTransport' => [
'default' => [
'className' => 'Mail',
/*
* The following keys are used in SMTP transports:
*/
'host' => 'localhost',
'port' => 25,
'timeout' => 30,
'username' => null,
'password' => null,
'client' => null,
'tls' => null,
'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
],
],
/**
* Email delivery profiles
*
* Delivery profiles allow you to predefine various properties about email
* messages from your application and give the settings a name. This saves
* duplication across your application and makes maintenance and development
* easier. Each profile accepts a number of keys. See `Cake\Mailer\Email`
* for more information.
*/
'Email' => [
'default' => [
'transport' => 'default',
'from' => 'you@localhost',
//'charset' => 'utf-8',
//'headerCharset' => 'utf-8',
],
],
我的CountForm :: __ execute()
protected function _execute(array $data)
{
$Mail = new Email('default');
return ($this->getMailer('Counter', $Mail)->send('sendCounterFromEbok', [$data]) && $this->getMailer('Counter', $Mail)->send('greetingsFromEbok', [$data]));
}
我的CakePhp版本是3.7.0