Exemplo n.º 1
0
 public function GetMailMIME()
 {
     $result = parent::GetMailMIME();
     $result = rtrim($result, $this->LE);
     if ($this->Mailer != 'mail') {
         $result .= $this->LE . $this->LE;
     }
     return $result;
 }
Exemplo n.º 2
0
        /**
	 * Sets message type to HTML.
	 * @param bool $bool
	 * @return void
	 */
	public function IsHTML($ishtml = true) {
               parent::IsHTML($ishtml);
               $this->sendHTML = $ishtml;
       }
Exemplo n.º 3
0
 function send()
 {
     if (empty($this->ReplyTo)) {
         $this->_addReplyTo($this->config->get('reply_email'), $this->config->get('reply_name'));
     }
     if ((bool) $this->config->get('embed_images', 0)) {
         $this->embedImages();
     }
     if (empty($this->Subject) or empty($this->Body)) {
         $this->reportMessage = JText::_('SEND_EMPTY');
         $this->errorNumber = 8;
         if ($this->report) {
             $this->app->enqueueMessage($this->reportMessage, 'error');
         }
         return false;
     }
     if (!$this->alreadyCheckedAddresses) {
         $this->alreadyCheckedAddresses = true;
         if (empty($this->ReplyTo[0][0]) || !$this->userHelper->validEmail($this->ReplyTo[0][0])) {
             $this->reportMessage = JText::_('VALID_EMAIL') . ' ( ' . JText::_('REPLYTO_ADDRESS') . ' : ' . $this->ReplyTo[0][0] . ' ) ';
             $this->errorNumber = 9;
             if ($this->report) {
                 $this->app->enqueueMessage($this->reportMessage, 'error');
             }
             return false;
         }
         if (empty($this->From) || !$this->userHelper->validEmail($this->From)) {
             $this->reportMessage = JText::_('VALID_EMAIL') . ' ( ' . JText::_('FROM_ADDRESS') . ' : ' . $this->From . ' ) ';
             $this->errorNumber = 9;
             if ($this->report) {
                 $this->app->enqueueMessage($this->reportMessage, 'error');
             }
             return false;
         }
         if (!empty($this->Sender) && !$this->userHelper->validEmail($this->Sender)) {
             $this->reportMessage = JText::_('VALID_EMAIL') . ' ( ' . JText::_('BOUNCE_ADDRESS') . ' : ' . $this->Sender . ' ) ';
             $this->errorNumber = 9;
             if ($this->report) {
                 $this->app->enqueueMessage($this->reportMessage, 'error');
             }
             return false;
         }
     }
     if (function_exists('mb_convert_encoding') && !empty($this->sendHTML)) {
         $this->Body = mb_convert_encoding($this->Body, 'HTML-ENTITIES', 'UTF-8');
         $this->Body = str_replace(array('&', 'ς'), array('&', 'ς'), $this->Body);
     }
     if ($this->CharSet != 'utf-8') {
         $this->Body = $this->encodingHelper->change($this->Body, 'UTF-8', $this->CharSet);
         $this->Subject = $this->encodingHelper->change($this->Subject, 'UTF-8', $this->CharSet);
         if (!empty($this->AltBody)) {
             $this->AltBody = $this->encodingHelper->change($this->AltBody, 'UTF-8', $this->CharSet);
         }
     }
     if (strpos($this->Host, 'elasticemail')) {
         $this->addCustomHeader('referral:2f0447bb-173a-459d-ab1a-ab8cbebb9aab');
     }
     $this->Subject = str_replace(array('’', '“', '”', '–'), array("'", '"', '"', '-'), $this->Subject);
     $this->Body = str_replace(" ", ' ', $this->Body);
     ob_start();
     $result = parent::Send();
     $warnings = ob_get_clean();
     if (!empty($warnings) && strpos($warnings, 'bloque')) {
         $result = false;
     }
     $receivers = array();
     foreach ($this->to as $oneReceiver) {
         $receivers[] = $oneReceiver[0];
     }
     if (!$result) {
         $this->reportMessage = JText::sprintf('SEND_ERROR', $this->Subject, implode('", "', $receivers));
         if (!empty($this->ErrorInfo)) {
             $this->reportMessage .= ' | ' . $this->ErrorInfo;
         }
         if (!empty($warnings)) {
             $this->reportMessage .= ' | ' . $warnings;
         }
         $this->errorNumber = 1;
         if ($this->report) {
             $this->app->enqueueMessage($this->reportMessage, 'error');
         }
     } else {
         $this->reportMessage = JText::sprintf('SEND_SUCCESS', $this->Subject, implode(' , ', $receivers));
         if (!empty($warnings)) {
             $this->reportMessage .= ' | ' . $warnings;
         }
         if ($this->report) {
             $this->app->enqueueMessage($this->reportMessage, 'message');
         }
     }
     return $result;
 }
Exemplo n.º 4
0
 function send()
 {
     if (empty($this->ReplyTo)) {
         $replyToName = $this->config->get('add_names', true) ? $this->config->get('reply_name') : '';
         $this->AddReplyTo($this->config->get('reply_email'), $replyToName);
     }
     if ((bool) $this->config->get('embed_images', 0)) {
         $this->embedImages();
     }
     if (empty($this->Subject) or empty($this->Body)) {
         $this->reportMessage = JText::_('SEND_EMPTY');
         $this->errorNumber = 8;
         return false;
     }
     if (function_exists('mb_convert_encoding') && !empty($this->sendHTML)) {
         $this->Body = mb_convert_encoding($this->Body, 'HTML-ENTITIES', 'UTF-8');
         $this->Body = str_replace('&', '&', $this->Body);
     }
     if ($this->CharSet != 'utf-8') {
         $this->Body = $this->encodingHelper->change($this->Body, 'UTF-8', $this->CharSet);
         $this->Subject = $this->encodingHelper->change($this->Subject, 'UTF-8', $this->CharSet);
         if (!empty($this->AltBody)) {
             $this->AltBody = $this->encodingHelper->change($this->AltBody, 'UTF-8', $this->CharSet);
         }
     }
     $this->Subject = str_replace(array('’', '“', '”'), array("'", '"', '"'), $this->Subject);
     $this->Body = str_replace(" ", ' ', $this->Body);
     ob_start();
     $result = parent::Send();
     $warnings = ob_get_clean();
     if (!empty($warnings) && strpos($warnings, 'bloque')) {
         $result = false;
     }
     $receivers = array();
     foreach ($this->to as $oneReceiver) {
         $receivers[] = $oneReceiver[0];
     }
     if (!$result) {
         $this->reportMessage = JText::sprintf('SEND_ERROR', $this->Subject, implode('", "', $receivers));
         if (!empty($this->ErrorInfo)) {
             $this->reportMessage .= ' | ' . $this->ErrorInfo;
         }
         if (!empty($warnings)) {
             $this->reportMessage .= ' | ' . $warnings;
         }
         $this->errorNumber = 1;
         if ($this->report) {
             $this->app->enqueueMessage($this->reportMessage, 'error');
         }
     } else {
         $this->reportMessage = JText::sprintf('SEND_SUCCESS', $this->Subject, implode('", "', $receivers));
         if (!empty($warnings)) {
             $this->reportMessage .= ' | ' . $warnings;
         }
         if ($this->report) {
             $this->app->enqueueMessage($this->reportMessage, 'message');
         }
     }
     return $result;
 }
Exemplo n.º 5
0
 function send()
 {
     if (!empty($this->sendHTML)) {
         $this->AltBody = $this->textVersion($this->Body, true);
     } else {
         $this->Body = $this->textVersion($this->Body, false);
     }
     if (empty($this->ReplyTo)) {
         $replyToName = $this->config->getValue('reply_name');
         $this->AddReplyTo($this->config->getValue('reply_email'), $replyToName);
     }
     if ((bool) $this->config->getValue('embed_images', 0) && !$this->isElasticRest && !$this->isSendGridRest) {
         $this->embedImages();
     }
     if (empty($this->Subject) or empty($this->Body)) {
         $this->reportMessage = __('There is no subject or body in this email', WYSIJA);
         $this->errorNumber = 8;
         return false;
     }
     if (function_exists('mb_convert_encoding') && !empty($this->sendHTML)) {
         $this->Body = mb_convert_encoding($this->Body, 'HTML-ENTITIES', 'UTF-8');
         $this->Body = str_replace('&', '&', $this->Body);
     }
     if ($this->CharSet != 'utf-8') {
         $this->Body = $this->encodingHelper->change($this->Body, 'UTF-8', $this->CharSet);
         $this->Subject = $this->encodingHelper->change($this->Subject, 'UTF-8', $this->CharSet);
         if (!empty($this->AltBody)) {
             $this->AltBody = $this->encodingHelper->change($this->AltBody, 'UTF-8', $this->CharSet);
         }
     }
     if ($this->isElasticRest) {
         $this->addCustomHeader('referral:cfb09bc8-558d-496b-83e6-b05e901a945c');
     }
     $this->Subject = str_replace(array('’', '“', '�', '–'), array("'", '"', '"', '-'), $this->Subject);
     $this->Body = str_replace(chr(194), chr(32), $this->Body);
     ob_start();
     $result = parent::Send();
     $warnings = ob_get_clean();
     if (!empty($warnings) && strpos($warnings, 'bloque')) {
         $result = false;
     }
     $receivers = array();
     foreach ($this->to as $oneReceiver) {
         $receivers[] = $oneReceiver[0];
     }
     if (!$result) {
         $this->reportMessage = sprintf(__('Error Sending Message <b><i>%s</i></b> to <b><i>%s</i></b>', WYSIJA), $this->Subject, implode('", "', $receivers));
         if (!empty($this->ErrorInfo)) {
             foreach ($this->ErrorInfo as $error) {
                 $this->reportMessage .= ' | ' . $error['error'];
             }
             $this->ErrorInfo = array();
         }
         if (!empty($warnings)) {
             $this->reportMessage .= ' | ' . $warnings;
         }
         $this->errorNumber = 1;
         if ($this->report) {
             $this->error($this->reportMessage);
         }
     } else {
         $this->reportMessage = sprintf(__('Successfully sent to <b><i>%s</i></b>', WYSIJA), implode('", "', $receivers));
         if ($this->report) {
             if (!empty($warnings)) {
                 $this->reportMessage .= ' | ' . $warnings;
                 $this->notice($this->reportMessage, false);
             }
         }
     }
     return $result;
 }
Exemplo n.º 6
0
 function send()
 {
     if (empty($this->ReplyTo)) {
         $replyToName = $this->config->get('add_names', true) ? $this->config->get('reply_name') : '';
         $this->AddReplyTo($this->config->get('reply_email'), $replyToName);
     }
     if ((bool) $this->config->get('embed_images', 0)) {
         $this->embedImages();
     }
     if (empty($this->Subject) or empty($this->Body)) {
         $this->reportMessage = JText::_('SEND_EMPTY');
         $this->errorNumber = 8;
         return false;
     }
     if (strtoupper($this->CharSet) != 'UTF-8') {
         $this->Body = $this->encodingHelper->change($this->Body, 'UTF-8', $this->CharSet);
         $this->Subject = $this->encodingHelper->change($this->Subject, 'UTF-8', $this->CharSet);
         if (!empty($this->AltBody)) {
             $this->AltBody = $this->encodingHelper->change($this->AltBody, 'UTF-8', $this->CharSet);
         }
     }
     $this->Body = str_replace(" ", ' ', $this->Body);
     ob_start();
     $result = parent::Send();
     $warnings = ob_get_clean();
     $receivers = array();
     foreach ($this->to as $oneReceiver) {
         $receivers[] = $oneReceiver[0];
     }
     if (!$result) {
         $this->reportMessage = JText::sprintf('SEND_ERROR', $this->Subject, implode('", "', $receivers));
         if (!empty($this->ErrorInfo)) {
             $this->reportMessage .= ' | ' . $this->ErrorInfo;
         }
         $this->errorNumber = 1;
         if ($this->report) {
             $this->app->enqueueMessage($this->reportMessage, 'error');
             if (!empty($warnings)) {
                 $this->app->enqueueMessage($warnings, 'notice');
             }
         }
     } else {
         $this->reportMessage = JText::sprintf('SEND_SUCCESS', $this->Subject, implode('", "', $receivers));
         if ($this->report) {
             $this->app->enqueueMessage($this->reportMessage, 'message');
         }
     }
     return $result;
 }
Exemplo n.º 7
0
 function send()
 {
     if (!empty($this->sendHTML)) {
         $this->AltBody = $this->textVersion($this->Body, true);
     } else {
         $this->Body = $this->textVersion($this->Body, false);
     }
     if (empty($this->ReplyTo)) {
         $replyToName = $this->config->getValue('reply_name');
         $this->AddReplyTo($this->config->getValue('reply_email'), $replyToName);
     }
     if (empty($this->Subject) or empty($this->Body)) {
         $this->reportMessage = __("There is no subject or body in this email", WYSIJA);
         $this->errorNumber = 8;
         return false;
     }
     if (function_exists('mb_convert_encoding') && !empty($this->sendHTML)) {
         $this->Body = mb_convert_encoding($this->Body, 'HTML-ENTITIES', 'UTF-8');
         $this->Body = str_replace('&amp;', '&', $this->Body);
     }
     if ($this->CharSet != 'utf-8') {
         $this->Body = $this->encodingHelper->change($this->Body, 'UTF-8', $this->CharSet);
         $this->Subject = $this->encodingHelper->change($this->Subject, 'UTF-8', $this->CharSet);
         if (!empty($this->AltBody)) {
             $this->AltBody = $this->encodingHelper->change($this->AltBody, 'UTF-8', $this->CharSet);
         }
     }
     $this->Subject = str_replace(array('’', '“', '”', '–'), array("'", '"', '"', '-'), $this->Subject);
     $this->Body = str_replace(chr(194), chr(32), $this->Body);
     ob_start();
     $result = parent::Send();
     $warnings = ob_get_clean();
     if (!empty($warnings) && strpos($warnings, 'bloque')) {
         $result = false;
     }
     $receivers = array();
     foreach ($this->to as $oneReceiver) {
         $receivers[] = $oneReceiver[0];
     }
     if (!$result) {
         $this->reportMessage = sprintf(__("Error Sending Message <b><i>%s</i></b> to <b><i>%s</i></b>", WYSIJA), $this->Subject, implode('", "', $receivers));
         if (!empty($this->ErrorInfo)) {
             foreach ($this->ErrorInfo as $error) {
                 $this->error($error['error']);
             }
         }
         if (!empty($warnings)) {
             $this->reportMessage .= ' | ' . $warnings;
         }
         $this->errorNumber = 1;
         if ($this->report) {
             $this->error($this->reportMessage);
         }
     } else {
         $this->reportMessage = sprintf(__("Message <b><i>%s</i></b> successfully sent to <b><i>%s</i></b>", WYSIJA), $this->Subject, implode('", "', $receivers));
         if ($this->report) {
             if (!empty($warnings)) {
                 $this->reportMessage .= ' | ' . $warnings;
                 $this->notice($this->reportMessage, false);
             }
         }
     }
     return $result;
 }