Skip to content

Commit ecce33a

Browse files
author
mcramer
committed
Update: SMTP mail class
1 parent d93be92 commit ecce33a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

interface/lib/classes/ispcmail.inc.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,9 @@ private function _smtp_close() {
492492
public function send($recipients) {
493493
if(!is_array($recipients)) $recipients = array($recipients);
494494

495+
if($this->use_smtp == true) $this->_crlf = "\r\n";
496+
else $this->_crlf = "\n";
497+
495498
$this->create();
496499

497500
$subject = '';
@@ -547,10 +550,10 @@ public function send($recipients) {
547550
if($recipname && !is_numeric($recipname)) $this->setHeader('To', $recipname . ' <' . $recip . '>');
548551
else $this->setHeader('To', $recip);
549552

550-
$mail_content = 'To: ' . $this->getHeader('To') . $this->_crlf;
553+
$mail_content = 'Subject: ' . $enc_subject . $this->_crlf;
554+
$mail_content .= 'To: ' . $this->getHeader('To') . $this->_crlf;
551555
if($this->getHeader('Bcc') != '') $mail_content .= 'Bcc: ' . $this->_encodeHeader($this->getHeader('Bcc'), $this->mail_charset) . $this->_crlf;
552556
if($this->getHeader('Cc') != '') $mail_content .= 'Cc: ' . $this->_encodeHeader($this->getHeader('Cc'), $this->mail_charset) . $this->_crlf;
553-
$mail_content .= 'Subject: ' . $enc_subject . $this->_crlf;
554557
$mail_content .= implode($this->_crlf, $headers) . $this->_crlf . $this->_crlf . $this->body;
555558

556559
fputs($this->_smtp_conn, $mail_content . $this->_crlf . '.' . $this->_crlf);

0 commit comments

Comments
 (0)