public function send($email, $fromName, $fromEmail)
    {
        try {
            $mailer = Yii::$app->mailer->compose();
            $mailer->setFrom([$fromEmail => $fromName]);
            $mailer->setTo($email['email']);
            $mailer->setSubject($email['subject']);
            $mailer->setHtmlBody($email['content']);
            $mailer->setTextBody(strip_tags(str_replace(
                ['<br>', '<br/>', '<br />', '</p>'],
                "\n",
                $email['content']
            )));
            return $mailer->send();
        } catch (Exception $e) {
            Log::error($e->getMessage(), null, __METHOD__);
        }
    }
public function send($email, $fromName, $fromEmail)
    {
        try {
            $mailer = Yii::$app->mailer->compose();
            $mailer->setFrom([$fromEmail => $fromName]);
            $mailer->setTo($email['email']);
            $mailer->setSubject($email['subject']);
            $mailer->setHtmlBody($email['content']);
            $mailer->setTextBody(strip_tags(str_replace(
                ['<br>', '<br/>', '<br />', '</p>'],
                "\n",
                $email['content']
            )));
            return $mailer->send();
        } catch (Exception $e) {
            Log::error($e->getMessage(), null, __METHOD__);
        }
    }
public function send ( $ email , $ fromName , $ fromEmail ) { try { $ mailer = Yii :: $ app -> mailer -> compose ( ) ; $ mailer -> setFrom ( [ $ fromEmail => $ fromName ] ) ; $ mailer -> setTo ( $ email [ 'email' ] ) ; $ mailer -> setSubject ( $ email [ 'subject' ] ) ; $ mailer -> setHtmlBody ( $ email [ 'content' ] ) ; $ mailer -> setTextBody ( strip_tags ( str_replace ( [ '<br>' , '<br/>' , '<br />' , '</p>' ] , "\n" , $ email [ 'content' ] ) ) ) ; return $ mailer -> send ( ) ; } catch ( Exception $ e ) { Log :: error ( $ e -> getMessage ( ) , null , __METHOD__ ) ; } }
Sends email using mailer component.
@param string $email
@param string $fromName
@param string $fromEmail
@return bool
Sends email using mailer component .