How to use the swiftMailer in Yii2

前端 未结 6 568
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-07 18:01

I can\'t finally understand how to use the swiftMailer extension in Yii2. Judging by that on this subject I didn\'t find questions, the task is trivial, but up to the end I

6条回答
  •  时光取名叫无心
    2020-12-07 18:10

    Warning: This option no longer available, as Mandrill was bought by Mailchimp

    Sometimes could be issues with using SwiftMailer not dependent from you. Like when I used mail.ru e-mail server. I found solution in laravel community and implemend in Yii2.

    You can use alternative service like https://mandrillapp.com/ (12k email per month, 250 within hour is free) and setting up like below:

    laravel community / setup mail with mandrill

    'host' => 'smtp.mandrillapp.com',
    'username' => 'user@domain.name',
    'password' => 'oDLKswXZIkry8634f1jCDg', // new generated API key by mandrill
    'port' => '587',
    'encryption' => 'tls',
    

    If you are using gmail email you can also can face with security issue. You can swith off security by allowing application use your gmail account.

    If you signed in with google use links below:

    https://www.google.com/settings/security/lesssecureapps

    Hope it will help somebody

提交回复
热议问题