Konfigurasi Mailing Yii2 dengan gmail

Arwan Prianto Mangidi
0





1. Buat "App Password" melalui google Account untuk email google yang akan digunakan sebagai email server. "App Password" akan digunakan di configurasi mailer yii2



2. Atur konfigurasi email di file main-local.php (yii2 advanced)

  'mailer' => [
            'class' => \yii\symfonymailer\Mailer::class,
            'viewPath' => '@common/mail',
            
            // send all mails to a file by default.
            'useFileTransport' => false,
           
            // SMTP server example:
            'transport' => [
                'scheme' => 'smtps',
                'host' => 'smtp.gmail.com',
                'username' => 'email_anda_xxxxxxx',
                'password' => 'app_password_xxxxxx',
                'port' => 587, // TLS
            //  'port' => 465, // SSL
            ],
            //
            // DSN example:
            //    'transport' => [
            //        'dsn' => 'smtp://user:pass@smtp.example.com:25',
            //    ],
            //
            // See: https://symfony.com/doc/current/mailer.html#using-built-in-transports
            // Or if you use a 3rd party service, see:
            // https://symfony.com/doc/current/mailer.html#using-a-3rd-party-transport
        ],
  

Posting Komentar

0 Komentar
Posting Komentar (0)