Browse Source

Add setMaxRecipients() for send email

Visman 4 years ago
parent
commit
a5bf19ed7f

+ 1 - 0
app/Models/Pages/Auth.php

@@ -230,6 +230,7 @@ class Auth extends Page
                 try {
                     $isSent = $this->c->Mail
                         ->reset()
+                        ->setMaxRecipients(1)
                         ->setFolder($this->c->DIR_LANG)
                         ->setLanguage($tmpUser->language)
                         ->setTo($tmpUser->email, $tmpUser->username)

+ 1 - 0
app/Models/Pages/Email.php

@@ -183,6 +183,7 @@ class Email extends Page
 
         return $this->c->Mail
             ->reset()
+            ->setMaxRecipients(1)
             ->setFolder($this->c->DIR_LANG)
             ->setLanguage($this->curUser->language)
             ->setTo($this->curUser->email)

+ 1 - 0
app/Models/Pages/Profile/Email.php

@@ -114,6 +114,7 @@ class Email extends Profile
                     try {
                         $isSent = $this->c->Mail
                             ->reset()
+                            ->setMaxRecipients(1)
                             ->setFolder($this->c->DIR_LANG)
                             ->setLanguage($this->curUser->language)
                             ->setTo($v->new_email, $this->curUser->username)

+ 2 - 0
app/Models/Pages/Register.php

@@ -187,6 +187,7 @@ class Register extends Page
             try {
                 $this->c->Mail
                     ->reset()
+                    ->setMaxRecipients((int) $this->c->config->i_email_max_recipients)
                     ->setFolder($this->c->DIR_LANG)
                     ->setLanguage($this->c->config->o_default_lang)
                     ->setTo($this->c->config->o_mailing_list)
@@ -223,6 +224,7 @@ class Register extends Page
             try {
                 $isSent = $this->c->Mail
                     ->reset()
+                    ->setMaxRecipients(1)
                     ->setFolder($this->c->DIR_LANG)
                     ->setLanguage($this->user->language)
                     ->setTo($v->email)

+ 1 - 0
app/Models/Pages/Report.php

@@ -182,6 +182,7 @@ class Report extends Page
 
         return $this->c->Mail
             ->reset()
+            ->setMaxRecipients((int) $this->c->config->i_email_max_recipients)
             ->setFolder($this->c->DIR_LANG)
             ->setLanguage($this->c->config->o_default_lang) // ????
             ->setTo($this->c->config->o_mailing_list)