74 foreach ($mail->
getTo() as $recipients) {
75 $recipient_pieces = array_filter(array_map(
'trim', explode(
',', $recipients)));
76 foreach ($recipient_pieces as $recipient) {
77 $this->
getMailer()->AddAddress($recipient,
'');
81 foreach ($mail->
getCc() as $carbon_copies) {
82 $cc_pieces = array_filter(array_map(
'trim', explode(
',', $carbon_copies)));
83 foreach ($cc_pieces as $carbon_copy) {
84 $this->
getMailer()->AddCC($carbon_copy,
'');
88 foreach ($mail->
getBcc() as $blind_carbon_copies) {
89 $bcc_pieces = array_filter(array_map(
'trim', explode(
',', $blind_carbon_copies)));
90 foreach ($bcc_pieces as $blind_carbon_copy) {
91 $this->
getMailer()->AddBCC($blind_carbon_copy,
'');
97 if ($mail->
getFrom()->hasReplyToAddress()) {
100 if ($mail->
getFrom()->hasEnvelopFromAddress()) {
106 $this->
getMailer()->AddAttachment($attachment[
'path'], $attachment[
'name']);
110 $this->
getMailer()->AddEmbeddedImage($image[
'path'], $image[
'cid'], $image[
'name']);
124 "Trying to delegate external email delivery:" .
125 " Initiated by: %s (%s) " .
126 "| To: %s | CC: %s | BCC: %s | Subject: %s " .
128 "| ReplyTo: %s / %s " .
129 "| EnvelopeFrom: %s",
132 implode(
', ', $mail->
getTo()),
133 implode(
', ', $mail->
getCc()),
134 implode(
', ', $mail->
getBcc()),
136 $mail->
getFrom()->getFromAddress(),
137 $mail->
getFrom()->getFromName(),
138 $mail->
getFrom()->getReplyToAddress(),
139 $mail->
getFrom()->getReplyToName(),
140 $mail->
getFrom()->getEnvelopFromAddress()
148 $this->mailer->SMTPDebug = 4;
149 $this->mailer->Debugoutput =
function (
$message, $level) {
151 strpos(
$message,
'Invalid address') !==
false ||
152 strpos(
$message,
'Message body empty') !== false
164 'Successfully delegated external mail delivery' 167 if (strlen($this->
getMailer()->ErrorInfo) > 0) {
169 '... with most recent errors: %s',
175 'Could not deliver external email: %s',
180 $this->eventHandler->raise(
'Services/Mail',
'externalEmailDelegated', [
PHPMailer - PHP email creation and transport class.
catch(Exception $e) $message
Interface ilMailMimeTransport.
__construct(\ilSetting $settings, \ilAppEventHandler $eventHandler)
ilMailMimeTransportBase constructor.
Class ilMailMimeTransportBase.
static getLogger($a_component_id)
Get component logger.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
send(\ilMimeMail $mail)
bool