| | |
| | | $from = null; |
| | | } |
| | | |
| | | // check 'From' address (identity may be incomplete) |
| | | if (!$savedraft && !$saveonly && empty($from)) { |
| | | $OUTPUT->show_message('nofromaddress', 'error'); |
| | | $OUTPUT->send('iframe'); |
| | | } |
| | | |
| | | if (!$from_string && $from) { |
| | | $from_string = $from; |
| | | } |
| | |
| | | $MAIL_MIME->setParam('html_charset', $message_charset); |
| | | $MAIL_MIME->setParam('text_charset', $text_charset); |
| | | |
| | | // encoding subject header with mb_encode provides better results with asian characters |
| | | if (function_exists('mb_encode_mimeheader')) { |
| | | mb_internal_encoding($message_charset); |
| | | $headers['Subject'] = mb_encode_mimeheader($headers['Subject'], |
| | | $message_charset, 'Q', "\r\n", 8); |
| | | mb_internal_encoding(RCUBE_CHARSET); |
| | | } |
| | | |
| | | // pass headers to message object |
| | | $MAIL_MIME->headers($headers); |
| | | |
| | | // This hook allows to modify the message before send or save action |
| | | $plugin = $RCMAIL->plugins->exec_hook('message_ready', array('message' => $MAIL_MIME)); |
| | | $MAIL_MIME = $plugin['message']; |
| | | |
| | | // Begin SMTP Delivery Block |
| | | if (!$savedraft && !$saveonly) { |
| | | // check 'From' address (identity may be incomplete) |
| | | if (empty($from)) { |
| | | $OUTPUT->show_message('nofromaddress', 'error'); |
| | | $OUTPUT->send('iframe'); |
| | | } |
| | | |
| | | // Handle Delivery Status Notification request |
| | | $smtp_opts['dsn'] = $dsn_enabled; |
| | | |