4 require_once
'Services/Mail/classes/Mime/Transport/interface.ilMailMimeTransport.php';
5 require_once
'Services/Logging/classes/public/class.ilLoggerFactory.php';
30 require_once
'libs/composer/vendor/autoload.php';
72 foreach ($mail->
getTo() as $recipients) {
73 $recipient_pieces = array_filter(array_map(
'trim', explode(
',', $recipients)));
74 foreach ($recipient_pieces as $recipient) {
75 $this->
getMailer()->AddAddress($recipient,
'');
79 foreach ($mail->
getCc() as $carbon_copies) {
80 $cc_pieces = array_filter(array_map(
'trim', explode(
',', $carbon_copies)));
81 foreach ($cc_pieces as $carbon_copy) {
82 $this->
getMailer()->AddCC($carbon_copy,
'');
86 foreach ($mail->
getBcc() as $blind_carbon_copies) {
87 $bcc_pieces = array_filter(array_map(
'trim', explode(
',', $blind_carbon_copies)));
88 foreach ($bcc_pieces as $blind_carbon_copy) {
89 $this->
getMailer()->AddBCC($blind_carbon_copy,
'');
95 if ($mail->
getFrom()->hasReplyToAddress()) {
98 if ($mail->
getFrom()->hasEnvelopFromAddress()) {
104 $this->
getMailer()->AddAttachment($attachment[
'path'], $attachment[
'name']);
108 $this->
getMailer()->AddEmbeddedImage($image[
'path'], $image[
'cid'], $image[
'name']);
122 "Trying to delegate external email delivery:" .
123 " Initiated by: %s (%s) " .
124 "| To: %s | CC: %s | BCC: %s | Subject: %s " .
126 "| ReplyTo: %s / %s " .
127 "| EnvelopeFrom: %s",
130 implode(
', ', $mail->
getTo()),
131 implode(
', ', $mail->
getCc()),
132 implode(
', ', $mail->
getBcc()),
134 $mail->
getFrom()->getFromAddress(),
135 $mail->
getFrom()->getFromName(),
136 $mail->
getFrom()->getReplyToAddress(),
137 $mail->
getFrom()->getReplyToName(),
138 $mail->
getFrom()->getEnvelopFromAddress()
143 $this->mailer->SMTPDebug = 4;
144 $this->mailer->Debugoutput =
function (
$message, $level) {
152 'Successfully delegated external mail delivery' 156 'Could not deliver external email: %s',
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
__construct(\ilSetting $settings)
ilMailMimeTransportBase constructor.
send(ilMimeMail $mail)
bool
PHPMailer - PHP email creation and transport class.
catch(Exception $e) $message
Interface ilMailMimeTransport.
Class ilMailMimeTransportBase.
static getLogger($a_component_id)
Get component logger.