deepsgjain
-
Posts
1 -
Joined
-
Last visited
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
PHPMailer sends duplicates
in Other Libraries
Posted
Problem Resolved:
Guys, here is the solution. the problem is with our object. It is not getting clear after sending the email, so it ads the second email again in TO or CC list and hence user gets duplicate email. Check the code below.
protected function AddAnAddress($kind, $address, $name = '') {
$this->$kind= array();//initialize becuase it is apeending email together and sending multiple times
if (!preg_match('/^(to|cc|bcc|Reply-To)$/', $kind)) {
$this->SetError($this->Lang('Invalid recipient array').': '.$kind);
Add one line of code in your function AddAnAddress() , as mentioned above in RED color and your problem will get resolve.
That is all
Enjoy programming.
- DJ