| | |
| | | */ |
| | | var $_eol = "\r\n"; |
| | | |
| | | |
| | | /** |
| | | * Constructor. |
| | | * |
| | |
| | | * charset - Content character set |
| | | * cid - Content ID to apply |
| | | * disposition - Content disposition, inline or attachment |
| | | * dfilename - Filename parameter for content disposition |
| | | * filename - Filename parameter for content disposition |
| | | * description - Content description |
| | | * name_encoding - Encoding of the attachment name (Content-Type) |
| | | * By default filenames are encoded using RFC2231 |
| | |
| | | |
| | | case 'body_file': |
| | | $this->_body_file = $value; |
| | | break; |
| | | |
| | | // for backward compatibility |
| | | case 'dfilename': |
| | | $params['filename'] = $value; |
| | | break; |
| | | } |
| | | } |
| | |
| | | |
| | | // Structured header (make sure addr-spec inside is not encoded) |
| | | if (!empty($separator)) { |
| | | // Simple e-mail address regexp |
| | | $email_regexp = '(\S+|("[^\r\n"]+"))@\S+'; |
| | | |
| | | $parts = Mail_mimePart::_explodeQuotedString($separator, $value); |
| | | $value = ''; |
| | | |
| | |
| | | } |
| | | |
| | | // let's find phrase (name) and/or addr-spec |
| | | if (preg_match('/^<\S+@\S+>$/', $part)) { |
| | | if (preg_match('/^<' . $email_regexp . '>$/', $part)) { |
| | | $value .= $part; |
| | | } else if (preg_match('/^\S+@\S+$/', $part)) { |
| | | } else if (preg_match('/^' . $email_regexp . '$/', $part)) { |
| | | // address without brackets and without name |
| | | $value .= $part; |
| | | } else if (preg_match('/<*\S+@\S+>*$/', $part, $matches)) { |
| | | } else if (preg_match('/<*' . $email_regexp . '>*$/', $part, $matches)) { |
| | | // address with name (handle name) |
| | | $address = $matches[0]; |
| | | $word = str_replace($address, '', $part); |