IMP_Compose::_prepSendMessage PHP Method

_prepSendMessage() protected method

Sanity checking/MIME formatting before sending a message.
protected _prepSendMessage ( Horde_Mail_Rfc822_List $email, Horde_Mime_Part $message = null ) : string
$email Horde_Mail_Rfc822_List The e-mail list to send to.
$message Horde_Mime_Part The object that contains the text to send.
return string The encoded $email list.
    protected function _prepSendMessage(Horde_Mail_Rfc822_List $email, $message = null)
    {
        /* Properly encode the addresses we're sending to. Always try
         * charset of original message as we know that the user can handle
         * that charset. */
        try {
            return $this->_prepSendMessageEncode($email, is_null($message) ? 'UTF-8' : $message->getHeaderCharset());
        } catch (IMP_Compose_Exception $e) {
            if (is_null($message)) {
                throw $e;
            }
        }
        /* Fallback to UTF-8 (if replying, original message might be in
         * US-ASCII, for example, but To/Subject/Etc. may contain 8-bit
         * characters. */
        $message->setHeaderCharset('UTF-8');
        return $this->_prepSendMessageEncode($email, 'UTF-8');
    }