1 | <?php |
||
25 | class MailUtility |
||
26 | { |
||
27 | /** |
||
28 | * Sends an e-mail, if sender and recipient is an valid e-mail address |
||
29 | * |
||
30 | * @param string $sender The sender |
||
31 | * @param string $recipient The recipient |
||
32 | * @param string $subject The subject |
||
33 | * @param string $body E-Mail body |
||
34 | * @param string $name Optional sendername |
||
35 | * @param array $attachments Array of files (e.g. ['/absolute/path/doc.pdf']) |
||
36 | * |
||
37 | * @return bool TRUE/FALSE if message is sent |
||
38 | */ |
||
39 | public static function sendEmailMessage($sender, $recipient, $subject, $body, $name = null, $attachments = []) |
||
54 | |||
55 | /** |
||
56 | * Adds given attachments to the given message |
||
57 | * |
||
58 | * @param MailMessage $message |
||
59 | * @param array $attachments |
||
60 | * return void |
||
61 | */ |
||
62 | protected static function addAttachments(&$message, $attachments) |
||
72 | } |