2
메일 본문에 이미지를 포함하고 싶습니다. http://www.yiiframework.com/doc-2.0/guide-tutorial-mailing.html에 대한 문서를 따르겠습니다.Yii2를 사용하여 메일에 이미지를 삽입 할 때 오류가 발생했습니다.
컨트롤러에 내 코드는 다음과 같습니다:
: 나는 그것을 실행할 때fopen(/WEBSITE_MONITOR/web/mail/images/logo.png): failed to open stream: No such file or directory
<a href="#"><img width="100" src="<?= $message->embed($logo); ?>"></a>
그러나, 그것은 나에게 오류를 제공합니다
$messages[] = Yii::$app->mailer->compose('downNotify', [
'websiteList' => $websiteList,
'logo' => Url::to('@web/mail/images/logo.png')
])
그리고 메일보기 파일
경로가 유효하지만 왜이 오류가 발생하는지 알 수 없습니다. 비슷한 문제가있는 사람이 있습니까?
덕분에, 그것을 작동합니다! – hugoinperson