2016-09-30 3 views
1

添付ファイル付きで約3000のメールを送信しています。このため、私はAntiFloodとThrottlerのプラグインを迅速に使用しています。yii2のSwift_Plugins_AntiFloodPluginの使い方

例外メッセージで「のYii \ベースの\ UnknownPropertyException」「未知のプロパティを設定:Yiiの\ではSwiftMailer \メーラー::プラグイン」ここ

は私が持っている私のメイン-local.phpファイルですが、私は次のエラーを取得しています追加されたプラグイン。 herepluginsキーはtransport内にある必要があります述べたように

 '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'   => 'mail.test.com', 
          'username'  => '[email protected]', 
          'password'  => '[email protected]', 
          'port'   => '25', 
          //'encryption' => 'tls', 
         ], 
     'plugins'=> [ 
         [ 
          'class' => 'Swift_Plugins_ThrottlerPlugin', 
          'constructArgs' => ['20'], 
         ], 
         [ 
          'class' => 'Swift_Plugins_AntiFloodPlugin', 
          'constructArgs' => [30,45], 
         ], 
        ], 
    ], 

おかげ

答えて

1

'mailer' => [ 
    'class' => 'yii\swiftmailer\Mailer', 
    'viewPath' => '@common/mail', 
    'useFileTransport' => false, 
    'transport' => [ 
     'class'   => 'Swift_SmtpTransport', 
     'host'   => 'mail.test.com', 
     'username'  => '[email protected]', 
     'password'  => '[email protected]', 
     'port'   => '25', 
     'plugins'=> [ 
      [ 
       'class' => 'Swift_Plugins_ThrottlerPlugin', 
       'constructArgs' => ['20'], 
      ], 
      [ 
       'class' => 'Swift_Plugins_AntiFloodPlugin', 
       'constructArgs' => [30,45], 
      ], 
     ], 
    ], 
], 
関連する問題