Goli
Goli

Reputation: 436

how to get mail from contact page yii2 advanced

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' => '[email protected]', //wrote admin email id here

also changes
'useFileTransport' => false, what is exact steps to make it active can any one solve this?

Upvotes: 0

Views: 193

Answers (1)

ScaisEdge
ScaisEdge

Reputation: 133400

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' => '[email protected]',
            'password' => 'your_gmail_password',
            'port' => '587',
            'encryption' => 'tls',
        ],

Upvotes: 3

Related Questions