| | |
| | | } |
| | | |
| | | // additional headers |
| | | if ($CONFIG['http_received_header']) |
| | | { |
| | | $nldlm = rcmail_header_delm() . "\t"; |
| | | $headers['Received'] = wordwrap('from ' . (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? |
| | | gethostbyaddr($_SERVER['HTTP_X_FORWARDED_FOR']).' ['.$_SERVER['HTTP_X_FORWARDED_FOR'].']'.$nldlm.' via ' : '') . |
| | | gethostbyaddr($_SERVER['REMOTE_ADDR']).' ['.$_SERVER['REMOTE_ADDR'].']'.$nldlm.'with ' . |
| | | $_SERVER['SERVER_PROTOCOL'].' ('.$_SERVER['REQUEST_METHOD'].'); ' . date('r'), |
| | | 69, $nldlm); |
| | | } |
| | | |
| | | $headers['Message-ID'] = $message_id; |
| | | $headers['X-Sender'] = $from; |
| | | $headers['Received'] = wordwrap('from ' . |
| | | (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? |
| | | gethostbyaddr($_SERVER['HTTP_X_FORWARDED_FOR']).' ['.$_SERVER['HTTP_X_FORWARDED_FOR'].'] via ' : '') . |
| | | gethostbyaddr($_SERVER['REMOTE_ADDR']).' ['.$_SERVER['REMOTE_ADDR'].'] with ' . |
| | | $_SERVER['SERVER_PROTOCOL'].' ('.$_SERVER['REQUEST_METHOD'].'); ' . date('r'), |
| | | 69, rcmail_header_delm() . "\t"); |
| | | |
| | | if (!empty($CONFIG['useragent'])) |
| | | $headers['User-Agent'] = $CONFIG['useragent']; |
| | |
| | | // add a plain text version of the e-mail as an alternative part. |
| | | $h2t = new html2text($message_body); |
| | | $plainTextPart = wordwrap($h2t->get_text(), 998, "\r\n", true); |
| | | if (!strlen($plainTextPart)) |
| | | { |
| | | // empty message body breaks attachment handling in drafts |
| | | $plainTextPart = "\r\n"; |
| | | } |
| | | $MAIL_MIME->setTXTBody(html_entity_decode($plainTextPart, ENT_COMPAT, 'utf-8')); |
| | | |
| | | // look for "emoticon" images from TinyMCE and copy into message as attachments |
| | |
| | | { |
| | | $message_body = wordwrap($message_body, 75, "\r\n"); |
| | | $message_body = wordwrap($message_body, 998, "\r\n", true); |
| | | if (!strlen($message_body)) |
| | | { |
| | | // empty message body breaks attachment handling in drafts |
| | | $message_body = "\r\n"; |
| | | } |
| | | $MAIL_MIME->setTXTBody($message_body, FALSE, TRUE); |
| | | } |
| | | |