/** * Send a plain-text email. * * @return bool */ public function sendPlain($to, $from, $subject, $plainContent, $attachedFiles = false, $customheaders = false) { $result = $this->sendPostmarkEmail($to, $from, $subject, false, $attachedFiles, $customheaders, $plainContent); if ($result === false) { // Fall back to regular Mailer $fallbackMailer = new Mailer(); $result = $fallbackMailer->sendPlain($to, $from, $subject, $plainContent, $attachedFiles, $customheaders); } return $result; }
function sendPlain($to, $from, $subject, $plainContent, $attachedFiles = false, $customheaders = false) { if (parent::sendPlain($to, $from, $subject, $plainContent, $attachedFiles = false, $customheaders = false)) { $log = new MailLog(); $log->To = $to; $log->From = $from; $log->Subject = $subject; $log->Body = $plainContent; $log->Date = date('Y-m-d H:i:s'); $log->write(); } else { throw new Exception("Mail not accepted for delivery to {$to}"); } }
/** */ function sendPlain($to, $from, $subject, $plainContent, $attachedFiles = false, $customHeaders = false) { if (self::$capture_emails) { $mail = new CapturedEmail(); $mail->To = $to; $mail->From = $from; $mail->Subject = $subject; if (is_array($customHeaders)) { foreach ($customHeaders as $header => $val) { $mail->Headers .= "{$header}: {$val} \n"; } } $mail->PlainText = $plainContent; if ($this->send) { $mail->SendID = $this->send->ID; } $mail->write(); } if (self::$outbound_send) { return parent::sendPlain($to, $from, $subject, $plainContent, $attachedFiles, $customHeaders); } return true; }
/** * Send a plain-text email. * * @param string $to Email recipient * @param string $from Email from * @param string $subject Subject text * @param string $plainContent Plain text content * @param array $attachedFiles List of attached files * @param array $customHeaders List of custom headers * @return mixed Return false if failure, or list of arguments if success */ public function sendPlain($to, $from, $subject, $plainContent, $attachedFiles = array(), $customHeaders = array()) { $rewrites = $this->mailblockRewrite($to, $subject, $customHeaders); parent::sendPlain($rewrites['to'], $from, $rewrites['subject'], $plainContent, $attachedFiles, $rewrites['headers']); }