2016-12-15 11 views
1

1台のサーバーからgodaddyにYii2 Webサイトを展開しました。その表示エラー: -Yii2 smtp電子メールがgodaddyで動作していません

'If you receive error " Connection could not be established with host smtp.gmail.com [Connection refused #111] "' 
私は下のメールのconfigsを設定している

: -

'mailer' => [ 
     'class' => 'yii\swiftmailer\Mailer', 
     'viewPath' => '@common/mail', 
     'transport' => [ 
      'class' => 'Swift_SmtpTransport', 
      'host' => 'smtp.gmail.com', 
      'username' => 't********[email protected]', 
      'password' => '***************', 
      'port' => '465', 
      'encryption' => 'tls', //depends if you need it 
     ], 
    ], 

答えて

1

私は以下のように輸送タグをコメント化し、それを解決: -

'mailer' => [ 
    'class' => 'yii\swiftmailer\Mailer', 
    'viewPath' => '@common/mail', 
    //'transport' => [ 
     // 'class' => 'Swift_SmtpTransport', 
     // 'host' => 'smtp.gmail.com', 
     // 'username' => 't********[email protected]', 
     // 'password' => '***************', 
     // 'port' => '465', 
     // 'encryption' => 'tls', //depends if you need it 
    // ], 
], 
+0

ない方法それは送信者、ホスト、ユーザーパスワードのものがここでコメントされている場合でも動作しますか? –

+0

わかりません。しかし、私はphp mail(mail())関数には資格情報が必要ないので、それを要求していないと思います。 –

関連する問題