diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-07-29 06:50:19 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-07-29 06:50:19 +0000 |
| commit | 37135861d72243401087a3c9d6924a54ca9f3678 (patch) | |
| tree | b09f82941ac2d5a15753702db506be643d38f9a7 /roundcubemail/program/lib/Mail/mime.php | |
| parent | c3653e1deae3782a04c9940102a95bf9cc17225a (diff) | |
- Mail-Mime-1.8.0
git-svn-id: https://svn.roundcube.net/trunk@3837 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/lib/Mail/mime.php')
| -rw-r--r-- | roundcubemail/program/lib/Mail/mime.php | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/roundcubemail/program/lib/Mail/mime.php b/roundcubemail/program/lib/Mail/mime.php index 9065d469a..481764a5a 100644 --- a/roundcubemail/program/lib/Mail/mime.php +++ b/roundcubemail/program/lib/Mail/mime.php @@ -842,13 +842,13 @@ class Mail_mime if (isset($this->_headers['From'])) { // Bug #11381: Illegal characters in domain ID - if (preg_match("|(@[0-9a-zA-Z\-\.]+)|", $this->_headers['From'], $matches)) { + if (preg_match('#(@[0-9a-zA-Z\-\.]+)#', $this->_headers['From'], $matches)) { $domainID = $matches[1]; } else { - $domainID = "@localhost"; + $domainID = '@localhost'; } foreach ($this->_html_images as $i => $img) { - $cid = $this->_html_images[$i]['cid']; + $cid = $this->_html_images[$i]['cid']; if (!preg_match('#'.preg_quote($domainID).'$#', $cid)) { $this->_html_images[$i]['cid'] = $cid . $domainID; } @@ -995,7 +995,7 @@ class Mail_mime $ret = null; return $ret; } - + // Use saved boundary if (!empty($this->_build_params['boundary'])) { $boundary = $this->_build_params['boundary']; @@ -1155,7 +1155,7 @@ class Mail_mime // add required boundary parameter if not defined if (preg_match('/^multipart\//i', $type)) { if (empty($this->_build_params['boundary'])) { - $this->_build_params['boundary'] = '=_' . md5(rand() . microtime()); + $this->_build_params['boundary'] = '=_' . md5(rand() . microtime()); } $header .= ";$eol boundary=\"".$this->_build_params['boundary']."\""; @@ -1191,6 +1191,24 @@ class Mail_mime } /** + * Add an email to the To header + * (multiple calls to this method are allowed) + * + * @param string $email The email direction to add + * + * @return void + * @access public + */ + function addTo($email) + { + if (isset($this->_headers['To'])) { + $this->_headers['To'] .= ", $email"; + } else { + $this->_headers['To'] = $email; + } + } + + /** * Add an email to the Cc (carbon copy) header * (multiple calls to this method are allowed) * |
