I am using 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?
In your config.php you should also configure a proper transport eg for a transport based of gmail account you could use
'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',
],
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.