Commit ecce33ad authored by mcramer's avatar mcramer
Browse files

Update: SMTP mail class

parent d93be923
...@@ -492,6 +492,9 @@ class ispcmail { ...@@ -492,6 +492,9 @@ class ispcmail {
public function send($recipients) { public function send($recipients) {
if(!is_array($recipients)) $recipients = array($recipients); if(!is_array($recipients)) $recipients = array($recipients);
if($this->use_smtp == true) $this->_crlf = "\r\n";
else $this->_crlf = "\n";
$this->create(); $this->create();
$subject = ''; $subject = '';
...@@ -547,10 +550,10 @@ class ispcmail { ...@@ -547,10 +550,10 @@ class ispcmail {
if($recipname && !is_numeric($recipname)) $this->setHeader('To', $recipname . ' <' . $recip . '>'); if($recipname && !is_numeric($recipname)) $this->setHeader('To', $recipname . ' <' . $recip . '>');
else $this->setHeader('To', $recip); else $this->setHeader('To', $recip);
$mail_content = 'To: ' . $this->getHeader('To') . $this->_crlf; $mail_content = 'Subject: ' . $enc_subject . $this->_crlf;
$mail_content .= 'To: ' . $this->getHeader('To') . $this->_crlf;
if($this->getHeader('Bcc') != '') $mail_content .= 'Bcc: ' . $this->_encodeHeader($this->getHeader('Bcc'), $this->mail_charset) . $this->_crlf; if($this->getHeader('Bcc') != '') $mail_content .= 'Bcc: ' . $this->_encodeHeader($this->getHeader('Bcc'), $this->mail_charset) . $this->_crlf;
if($this->getHeader('Cc') != '') $mail_content .= 'Cc: ' . $this->_encodeHeader($this->getHeader('Cc'), $this->mail_charset) . $this->_crlf; if($this->getHeader('Cc') != '') $mail_content .= 'Cc: ' . $this->_encodeHeader($this->getHeader('Cc'), $this->mail_charset) . $this->_crlf;
$mail_content .= 'Subject: ' . $enc_subject . $this->_crlf;
$mail_content .= implode($this->_crlf, $headers) . $this->_crlf . $this->_crlf . $this->body; $mail_content .= implode($this->_crlf, $headers) . $this->_crlf . $this->_crlf . $this->body;
fputs($this->_smtp_conn, $mail_content . $this->_crlf . '.' . $this->_crlf); fputs($this->_smtp_conn, $mail_content . $this->_crlf . '.' . $this->_crlf);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment