T
T
Theory Theory2020-09-01 06:57:21
Yii
Theory Theory, 2020-09-01 06:57:21

SwiftMailer embed doesn't have access to the picture?

Controller:

$res = Yii::$app->mailer->compose('hello', [
  'img'  => '/project/favicon.ico'
])


Hello.php email template:
/* @var $this \yii\web\View view component instance */
/* @var $message \yii\mail\BaseMessage instance of newly created mail message */

<img src="<?php $message->embed($img); ?>" alt="">


Result: Unable to open file for reading [/project/favicon.ico] Checked

permissions, 777

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question