core/components/Mail.php
public function convertMessageToAltBody($message)
    {
        $message = preg_replace('/<head>(.*?)<\/head>/s', '', $message);
        $tags = ['</p>', '<br />', '<br>', '<hr />', '<hr>', '</h1>', '</h2>', '</h3>', '</h4>', '</h5>', '</h6>'];
        return trim(strip_tags(str_replace($tags, PHP_EOL, $message)));
    }
public function convertMessageToAltBody($message)
    {
        $message = preg_replace('/<head>(.*?)<\/head>/s', '', $message);
        $tags = ['</p>', '<br />', '<br>', '<hr />', '<hr>', '</h1>', '</h2>', '</h3>', '</h4>', '</h5>', '</h6>'];
        return trim(strip_tags(str_replace($tags, PHP_EOL, $message)));
    }
public function convertMessageToAltBody ( $ message ) { $ message = preg_replace ( '/<head>(.*?)<\/head>/s' , '' , $ message ) ; $ tags = [ '</p>' , '<br />' , '<br>' , '<hr />' , '<hr>' , '</h1>' , '</h2>' , '</h3>' , '</h4>' , '</h5>' , '</h6>' ] ; return trim ( strip_tags ( str_replace ( $ tags , PHP_EOL , $ message ) ) ) ; }
Try to convert the message into an alt body tag.

The alt body can only contain chars and newline. Therefore strip all tags and replace ending tags with newlines.
Also remove html head if there is any.

@param string $message The message to convert into alt body format.
@return string Returns the alt body message compatible content
@since 1.0.11
Try to convert the message into an alt body tag .