| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function sendMail(?string $replyAddress, $to, $subject, $content, $headers = array()) |
||
| 33 | { |
||
| 34 | if ($replyAddress !== null) { |
||
| 35 | $headers['Reply-To'] = $replyAddress; |
||
| 36 | } |
||
| 37 | |||
| 38 | $headers['From'] = $this->emailFrom; |
||
| 39 | $headers['X-ACC-Instance'] = $this->instance; |
||
| 40 | $headerString = ''; |
||
| 41 | |||
| 42 | foreach ($headers as $header => $headerValue) { |
||
| 43 | $headerString .= $header . ': ' . $headerValue . "\r\n"; |
||
| 44 | } |
||
| 45 | |||
| 46 | mail($to, $subject, $content, $headerString); |
||
| 47 | } |
||
| 48 | } |