[英]how to get mail from contact page yii2 advanced
I am using yii2 advance . 我正在使用yii2 advance。 I want the contact form to send email to admin. 我希望联系表单将电子邮件发送给管理员。 but Its not working what should do? 但是它不起作用应该怎么办? I tried in following way=> 我尝试了以下方式=>
'adminEmail' => 'admin@example.com', //wrote admin email id here
also changes 也改变
'useFileTransport' => false,
what is exact steps to make it active can any one solve this? 'useFileTransport' => false,
使它处于活动状态的确切步骤是什么?
In your config.php you should also configure a proper transport eg for a transport based of gmail account you could use 在您的config.php中,您还应该配置适当的传输方式,例如,可以使用的基于gmail帐户的传输方式
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
.....
'useFileTransport' => false,//set this property to false to send mails to real email addresses
//comment the following array to send mail using php's mail function
//
//
/* configurazione servizio email da usare in locale (localhost sviluppo) */
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.gmail.com',
'username' => 'your_gmail_username@gmail.com',
'password' => 'your_gmail_password',
'port' => '587',
'encryption' => 'tls',
],
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.