72 if (is_array($params)) {
73 $this->_params = join(
' ', $params);
75 $this->_params = $params;
82 if (defined(
'PHP_EOL')) {
85 $this->sep = (strpos(PHP_OS,
'WIN') ===
false) ?
"\n" :
"\r\n";
115 function send($recipients, $headers, $body)
117 if (!is_array($headers)) {
122 if (is_a(
$result,
'PEAR_Error')) {
127 if (is_array($recipients)) {
128 $recipients = implode(
', ', $recipients);
134 if (isset($headers[
'Subject'])) {
135 $subject = $headers[
'Subject'];
136 unset($headers[
'Subject']);
141 unset($headers[
'To']);
145 if (is_a($headerElements,
'PEAR_Error')) {
146 return $headerElements;
148 list(, $text_headers) = $headerElements;
152 if (empty($this->_params) || ini_get(
'safe_mode')) {
153 $result = mail($recipients, $subject, $body, $text_headers);
155 $result = mail($recipients, $subject, $body, $text_headers,
Mail_mail($params=null)
Constructor.
send($recipients, $headers, $body)
Implements Mail_mail::send() function using php's built-in mail() command.
_sanitizeHeaders(&$headers)
Sanitize an array of mail headers by removing any additional header strings present in a legitimate h...
internal PHP-mail() implementation of the PEAR Mail:: interface.
prepareHeaders($headers)
Take an array of mail headers and return a string containing text usable in sending a message...
& raiseError($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
This method is a wrapper that returns an instance of the configured error class with this object's de...