Code Duplication    Length = 9-9 lines in 3 locations

lib/Ajde/Mailer/class.phpmailer.php 3 locations

@@ 1294-1302 (lines=9) @@
1291
        }
1292
1293
        // Attempt to send attach all recipients
1294
        foreach ($this->to as $to) {
1295
            if (!$this->smtp->recipient($to[0])) {
1296
                $bad_rcpt[] = $to[0];
1297
                $isSent = 0;
1298
            } else {
1299
                $isSent = 1;
1300
            }
1301
            $this->doCallback($isSent, $to[0], '', '', $this->Subject, $body, $this->From);
1302
        }
1303
        foreach ($this->cc as $cc) {
1304
            if (!$this->smtp->recipient($cc[0])) {
1305
                $bad_rcpt[] = $cc[0];
@@ 1303-1311 (lines=9) @@
1300
            }
1301
            $this->doCallback($isSent, $to[0], '', '', $this->Subject, $body, $this->From);
1302
        }
1303
        foreach ($this->cc as $cc) {
1304
            if (!$this->smtp->recipient($cc[0])) {
1305
                $bad_rcpt[] = $cc[0];
1306
                $isSent = 0;
1307
            } else {
1308
                $isSent = 1;
1309
            }
1310
            $this->doCallback($isSent, '', $cc[0], '', $this->Subject, $body, $this->From);
1311
        }
1312
        foreach ($this->bcc as $bcc) {
1313
            if (!$this->smtp->recipient($bcc[0])) {
1314
                $bad_rcpt[] = $bcc[0];
@@ 1312-1320 (lines=9) @@
1309
            }
1310
            $this->doCallback($isSent, '', $cc[0], '', $this->Subject, $body, $this->From);
1311
        }
1312
        foreach ($this->bcc as $bcc) {
1313
            if (!$this->smtp->recipient($bcc[0])) {
1314
                $bad_rcpt[] = $bcc[0];
1315
                $isSent = 0;
1316
            } else {
1317
                $isSent = 1;
1318
            }
1319
            $this->doCallback($isSent, '', '', $bcc[0], $this->Subject, $body, $this->From);
1320
        }
1321
1322
        if (count($bad_rcpt) > 0) { //Create error message for any bad addresses
1323
            throw new phpmailerException($this->lang('recipients_failed').implode(', ', $bad_rcpt));