cvs: pearweb /include/Damblan Mailer.php

From: Date: Sun, 10 Feb 2008 19:01:05 +0000
Subject: cvs: pearweb /include/Damblan Mailer.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-50961@lists.php.net to get a copy of this message
dufuz Sun Feb 10 19:01:05 2008 UTC Modified files: /pearweb/include/Damblan Mailer.php Log: Cosmetics http://cvs.php.net/viewvc.cgi/pearweb/include/Damblan/Mailer.php?r1=1.13&r2=1.14&diff_format=u Index: pearweb/include/Damblan/Mailer.php diff -u pearweb/include/Damblan/Mailer.php:1.13 pearweb/include/Damblan/Mailer.php:1.14 --- pearweb/include/Damblan/Mailer.php:1.13 Sun Jan 13 18:02:18 2008 +++ pearweb/include/Damblan/Mailer.php Sun Feb 10 19:01:05 2008 @@ -45,7 +45,7 @@ 'To' => PEAR_WEBMASTER_EMAIL, 'From' => 'pear-sys@php.net', 'Reply-To' => PEAR_WEBMASTER_EMAIL, - 'Return-Path' => PEAR_BOUNCE_EMAIL°, + 'Return-Path' => PEAR_BOUNCE_EMAIL, 'Errors-To' => PEAR_BOUNCE_EMAIL, 'Bounces-To' => PEAR_BOUNCE_EMAIL, 'X-Mailer' => 'PEARWeb - http://pear.php.net', @@ -117,16 +117,19 @@ if (PEAR::isError($data)) { return $data; } + // Merge additional header information to the generated data $data = $this->_mergeHeaders($data, $headers); if (PEAR::isError($data)) { return $data; } + // Check sanity of the email headers $data = $this->_sanitize($data); if (PEAR::isError($data)) { return $data; } + // Restructure data for use with PEAR::Mail (To-header and body are submitted directly) foreach ($data as $field => $content) { switch (strtolower($field)) { @@ -145,15 +148,18 @@ break; } } + // Attempt to send mail: $mail = Mail::factory('mail', array('-f bounces-ignored@php.net')); if (PEAR::isError($mail)) { return PEAR::raiseError('Could not create Mail instance. '.$mail->getMessage()); } + $res = $mail->send($to, $data, $body); if (PEAR::isError($res)) { return PEAR::raiseError('Unable to send mail. '.$res->getMessage()); } + return true; } @@ -173,6 +179,7 @@ $data[$headerName] = $header; } } + return $data; } @@ -220,6 +227,7 @@ } } } + return $data; } @@ -234,8 +242,7 @@ function _compile() { // Prepare preg_replace() arrays - $data['patterns'] = array(); - $data['replacements'] = array(); + $data['patterns'] = $data['replacements'] = array(); foreach ($this->_data as $var => $rep) { $data['patterns'][] = "/%$var%/"; $data['replacements'][] = $rep; @@ -255,7 +262,7 @@ // Save the compiled data $res[$key] = $val; } + return $res; } -} -?> +} \ No newline at end of file

« previous php.pear.cvs (#50961) next »