/**
* Inner mailer initialization from set variables
*
* @return void
*/
protected function initMailFromSet()
{
$this->mail->setLanguage($this->get('langLocale'), $this->get('langPath'));
$this->mail->CharSet = $this->get('charset');
$this->mail->From = $this->get('from');
$this->mail->FromName = $this->get('fromName') ?: $this->get('from');
$this->mail->Sender = $this->get('from');
$this->mail->clearAllRecipients();
$this->mail->clearAttachments();
$this->mail->clearCustomHeaders();
$emails = explode(static::MAIL_SEPARATOR, $this->get('to'));
foreach ($emails as $email) {
$this->mail->addAddress($email);
}
$this->mail->Subject = $this->get('subject');
$this->mail->AltBody = $this->createAltBody($this->get('body'));
$this->mail->Body = $this->get('body');
// add custom headers
foreach ($this->get('customHeaders') as $header) {
$this->mail->addCustomHeader($header);
}
if (is_array($this->get('images'))) {
foreach ($this->get('images') as $image) {
// Append to $attachment array
$this->mail->addEmbeddedImage($image['path'], $image['name'] . '@mail.lc', $image['name'], 'base64', $image['mime']);
}
}
}