yii2 cuts css classes in the emails
<p>I send email using template :</p>

<pre><code>         $content='Message';
         Yii::$app-&gt;mailer-&gt;compose('@app/mail/templates/templ', ['content'=&gt;$content])
        -&gt;setFrom('gorobets.asya@gmail.com')
        -&gt;setTo('nastya.g2410@gmail.com')
        -&gt;setSubject('Message subject')
        -&gt;send();
</code></pre>

<p>And my template :</p>

<pre><code>&lt;?php
use yii\helpers\Html;

/* @var $this \yii\web\View view component instance */
/* @var $message \yii\mail\MessageInterface the message being composed */
/* @var $content string main view render result */
?&gt;
&lt;?php $this-&gt;beginPage() ?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=&lt;?=   Yii::$app-&gt;charset ?&gt;" /&gt;
    &lt;style type="text/css"&gt;
        .footer {
         color: red;
        }
    &lt;/style&gt;
    &lt;?php $this-&gt;head() ?&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php $this-&gt;beginBody() ?&gt;
&lt;?= $content ?&gt;
&lt;div class="footer"&gt;With kind regards &lt;/div&gt;
&lt;?php $this-&gt;endBody() ?&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;?php $this-&gt;endPage() ?&gt;
</code></pre>

<p>When I read my email I can see that css classes doesn't work.  Class 'footer' also.
How can I solve this problem?</p>