ปัญหาการตั้งค่าการส่งe-mail ผ่านทาง gmail smtp ใน yii framework 2

wave
benzkub072
2,517
สังคมนักพัฒนาระบบ (Community)
ปัญหาการตั้งค่าการส่งe-mail ผ่านทาง gmail smtp ใน yii framework 2

ผมตั้งค่าดังนี้

ใน controller

ฟ้อง errorดังนี้

7 ความคิดเห็น

  • benzkub072

  • มานพ กองอุ่น
'mailer' => [
                'class' => 'yii\swiftmailer\Mailer',
                'viewPath' => '@common/mail',
                'useFileTransport' => false,
                'transport' => [
                    'class' => 'Swift_SmtpTransport',
                    'host' => 'smtp.google.com',
                    'username' => 'your_username',
                    'password' => 'your_password',
                    'port' => '587',
                    'encryption' => 'ssl',
                ],
            ],

ที่ผมใช้อยู่นะ ลองดูนะครับ และลองเปิด

https://myaccount.google.com/lesssecureapps?pli=1

 

error ใหม่

เปิด Lesssecure app หรือยังครับ https://myaccount.google.com/lesssecureapps

ทำแล้วครับ

ลองตั้งค่าในหน้านี้ครับ

https://myaccount.google.com/security#connectedapps

การยืนยันแบบสองขั้นตอน ปิด

อนุญาตแอปที่มีความปลอดภัยน้อย เปิด

ไม่ทราบว่าได้ไหมครับ

ตั้งค่าตามที่บอกแล้ว ไม่ได้ครับ บนserver ไม่ได้ แต่ใน local ได้