/ Published in: PHP
This is a Class that allows you create a letter with correct headers and send it to multi-emails.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
class Letter { private $subject; private $message; private $addHeaders; private $charset; function __construct( $subject, $message, $fromEmail = null, $fromName = null, $charset = 'utf-8') { $this->charset = $charset; { $messageString = ''; foreach ($message as $value) $messageString .= "$value\n"; $message = $messageString; } $this->message = $message; 'Content-Type' => 'text/plain; charset="' .$charset. '"', 'Content-Transfer-Encoding' => '8bit' ); $addHeaders = ''; foreach ($addHeadersList as $key => $value) $addHeaders .= "$key: $value "; $this->addHeaders = $addHeaders; } public function send($toEmail, $toName = null) { { $index = 0; while ($toEmail[$index]) { $overallResult = false; return $overallResult; } } else { } } }