2016-10-15 1 views
3

がyii2を使用していますし、のYiiではSwiftMailerは

<?php 
    return [ 
    'components' => [ 
    .... 
    'mailer' => [ 
     'class' => 'yii\swiftmailer\Mailer', 
     'viewPath' => '@common/mail', 
     // send all mails to a file by default. You have to set 
     // 'useFileTransport' to false and configure a transport 
     // for the mailer to send real emails. 
     'useFileTransport' => false, 
     'transport' => [ 
      'class' => 'Swift_SmtpTransport', 
      'host' => 'smtp.gmail.com', 
      'username' => '[email protected]', 
      'password' => 'mygmailpassword', 
      'port' => '465', 
      'encryption' => 'ssl', 
     ], 
    ], 
], 

]を次のように私は、メーラーの設定を持っているライブサーバーで動作するように失敗しました。

完全にローカルホストで上記作品が、私はライブサーバーにアップロードすると失敗し、私はいつも

エラーが間違っている可能性が何

Swift_TransportException 

Expected response code 250 but got code "535", with message "535-5.7.8  
Username and Password not accepted. Learn more at 

535 5.7.8 https://support.google.com/mail/?p=BadCredentials 
r199sm3707144wme.1 - gsmtp 

ある悪い信用証明書のエラーが出ます、

答えて

1

私はこの設定をgmail(および仕事)に使用します。

 'transport' => [ 
      'class' => 'Swift_SmtpTransport', 
      'host' => 'smtp.gmail.com', 
      'username' => '[email protected]', 
      'password' => 'mypass', 
      'port' => '587', 
      'encryption' => 'tls', 
     ], 
+0

ポートを587として追加しても同じエラーが表示される –

+0

メッセージにはユーザー名またはパスワードの問題が伝えられます。資格情報も確認してください – scaisEdge

+0

ローカルのwampserverではすべて正常に動作します。私のGmailのメールアドレスとパスワードです。 Gmail以外のyiiのためのtrnsportオプションがありますか? –

関連する問題