Без изображения у меня код работает, но если добавляю фото - оно не отображается.
Подскажите что делать.
код страницы для отправки на почту
Код: Выделить всё
<?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 */
?>
<?php $this->beginPage() ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?= Yii::$app->charset ?>" />
<title>Blockchain Alliance</title>
<?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>
<div class="email_container" style="width:100%;max-width:800px;margin:auto;min-width:600px;">
<div class="email_header" style='background:url("http://mioboutique.net/img/email/header.jpg");width:100%;height:245px;background-repeat:no-repeat;background-size:contain;background-position:top;margin-bottom:50px;'>
<div class="email_header_link_wrap" style="height:110px;padding-top:130px;width:100%;">
<a href="http://<?=$_SERVER['SERVER_NAME'];?>" class="email_header_link" style="display:inline-block;margin-right:10%;float:right;">
<img src="http://<?=$_SERVER['SERVER_NAME'];?>/web/images/email/btn-link.png" alt="btn-link">
</a>
</div>
</div>
<div class="email_text" style='padding-left:10%;padding-right:10%;color:#1c1c1c;font:300 15px/20px "Lato", "Roboto", "Arial", sans-serif;'>
<?= $content ?>
</div>
<div class="email_footer" style='background:url("http://mioboutique.net/img/email/footer-bg.jpg");width:100%;height:275px;background-repeat:no-repeat;background-size:contain;background-position:bottom;'>
<div class="email_contact" style="margin-top:100px;margin-left:10%;float:left;">
<div style="margin-bottom:10px;">
<a href="#" style='font:400 15px/25px "Proxima Nova", "Lato", "Roboto", "Arial", sans-serif;text-decoration:none;color:#ffffff;'><img src="/mioboutique.net/img/email/loc.png" alt="" style="margin-right:25px;margin-bottom:-3px;">21. Giles St., Belize City,
Belize
</a>
</div>
<div style="margin-bottom:10px;">
<a href="skype:Blockchain_Alliance" style='font:400 15px/25px "Proxima Nova", "Lato", "Roboto", "Arial", sans-serif;text-decoration:none;color:#ffffff;'><img src="http://mioboutique.net/img/email/skype.png" alt="" style="margin-right:25px;margin-bottom:-3px;">Blockchain_Alliance</a>
</div>
<div style="margin-bottom:10px;">
<a href="mailto:support@blockchain-alliance.biz" style='font:400 15px/25px "Proxima Nova", "Lato", "Roboto", "Arial", sans-serif;text-decoration:none;color:#ffffff;'><img src="http://mioboutique.net/img/email/email.png" alt="" style="margin-right:25px;margin-bottom:-3px;">support@blockchain-alliance.biz</a>
</div>
<div style="margin-bottom:10px;">
<a href="https://blockchain-alliance.biz/" style='font:400 15px/25px "Proxima Nova", "Lato", "Roboto", "Arial", sans-serif;text-decoration:none;color:#ffffff;'><img src="http://mioboutique.net/img/email/site.png" alt="" style="margin-right:25px;margin-bottom:-3px;">blockchain-alliance.biz</a>
</div>
</div>
</div>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
Код: Выделить всё
public function sendEmail()
{
/* @var $user User */
$user = User::findOne([
'status' => User::STATUS_ACTIVE,
'email' => $this->email,
]);
if ($user) {
if ($user->save()) {
return Yii::$app->mailer->compose(['html' => 'register-html', 'text' => 'register-text'], ['user' => $user])
->setFrom(['Blockchain'])
->setTo($this->email)
->setSubject('REGISTER')
->send();
}
}
return false;
}