aboutsummaryrefslogtreecommitdiffstats
path: root/include/class_smtp_mail.inc.php
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2008-03-18 21:58:48 +0000
committerrub <rub@piwigo.org>2008-03-18 21:58:48 +0000
commit4c92087d6b006fbee6203e035741ff190a9d4056 (patch)
treed5f9386009306adb2a3b3aea2fc673a42dfe19ec /include/class_smtp_mail.inc.php
parent8164f0c66e5ec184eba168a7c3abb80363f72bb7 (diff)
Resolved issue 0000815: Email format standardization
git-svn-id: http://piwigo.org/svn/branches/branch-1_7@2283 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/class_smtp_mail.inc.php')
-rw-r--r--include/class_smtp_mail.inc.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/class_smtp_mail.inc.php b/include/class_smtp_mail.inc.php
index 450bcada9..c3dbc7964 100644
--- a/include/class_smtp_mail.inc.php
+++ b/include/class_smtp_mail.inc.php
@@ -2,7 +2,7 @@
// +-----------------------------------------------------------------------+
// | PhpWebGallery - a PHP based picture gallery |
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
-// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// | Copyright (C) 2003-2008 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
// | file : $Id$
// | last update : $Date$
@@ -121,21 +121,26 @@ class smtp_mail
$this->server_write('MAIL FROM: <'.$this->email_webmaster.'>'."\r\n");
$this->server_parse('250');
- $to_header = 'To: ';
+ if (preg_match('/^\s*to\s*:.*/mi', $headers) === 0)
+ {
+ $to_header = 'To: '.implode(',', array_map(create_function('$email','return "<".$email.">";'), $recipients));
+ }
+ else
+ {
+ $to_header = '';
+ }
@reset($recipients);
while (list(, $email) = @each($recipients))
{
$this->server_write('RCPT TO: <'.$email.'>'."\r\n");
$this->server_parse('250');
-
- $to_header .= '<'.$email.'>, ';
}
$this->server_write('DATA'."\r\n");
$this->server_parse('354');
- $this->server_write('Subject: '.$subject."\r\n".$to_header."\r\n".$headers."\r\n\r\n".$message."\r\n");
+ $this->server_write('Subject: '.$subject."\r\n".(empty($to_header) ? "" : $to_header."\r\n").$headers."\r\n\r\n".$message."\r\n");
$this->server_write('.'."\r\n");
$this->server_parse('250');