Conditions | 3 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | public function send(Envelope $envelope) |
||
32 | { |
||
33 | $this->validate($envelope); |
||
34 | |||
35 | $mail = $this->prepareMailer($envelope); |
||
36 | |||
37 | // Call the preSend to set all PHPMailer variables and get the correct header and body; |
||
38 | $messageParts = $mail->getMessageEnvelopeParts(); |
||
39 | |||
40 | // Fix BCC header because PHPMailer does not send to us |
||
41 | foreach ((array)$envelope->getBCC() as $bccEmail) { |
||
42 | $messageParts['header'] .= 'Bcc: ' . $bccEmail . "\n"; |
||
43 | } |
||
44 | |||
45 | foreach ($envelope->getTo() as $toEmail) { |
||
46 | mail($toEmail, $envelope->getSubject(), $messageParts['body'], $messageParts['header']); |
||
47 | } |
||
48 | |||
49 | return true; |
||
50 | } |
||
52 |