这是我的邮件配置:
'mail' => [
'class' => 'zyx\phpmailer\Mailer',
// 'viewPath' => 'mail',
'useFileTransport' => false,
'config' => [
'mailer' => 'smtp',
'host' => 'mail.poorad.com',
'port' => '25',
// 'smtpsecure' => 'tls',
'smtpauth' => true,
'username' => '***@poorad.com',
'password' => '***',
],
],
这是我发送邮件的代码:
$a = Yii::$app->mail->compose('passwordResetToken', ['mili' => 'miliii'])
->setFrom('from@domain.com')
->setTo('mysaltern@gmail.com')
->setSubject('Advanced email from Yii2-SwiftMailer')
->send();
但在:
<?php
echo $mili;
我有这个错误:Undefined variable: mili
我如何才能访问$ mili?