Closed andyk72 closed 10 years ago
Update: solved!
The problem was orginated by the fact that in yii console applications the 'webroot' alias does not point to the same directory as in web applications, but resolves to the same as the 'application' alias (e.g the 'protected' directory).
So, my images are in webroot.images.mail, as it is defined in
/protected/config/mail.php
...
'baseDirPath' => 'webroot.images.mail',
...
but they were searched for in application.images.mail and obviously were not found. Since this did not turned out in any explicit error, this was quite a bit tricky for me to understand:-)
I solved the issue by adding at the top of
/protected/config/console.php
my custom definition of the webroot.images.mail alias:
Yii::setPathOfAlias('webroot.images.mail', 'C:\\my_web_app_root\\images\\mail');
That is a great find, sorry about your problem. There is an issue with Yii https://github.com/yiisoft/yii/issues/1267
Basically you should not rely on webroot alias but define your own. Maybe I'll add a note about this in documentation.
Hi, I am using the Yii 1.1.8 with YiiMailer 1.5.
I am sending html emails with images from views.
From inside a web app page in the browser, everything works great and I am successfully sending beautiful html email with attached images; images are perfectly embedded into the message body.
However, using the exact same piece of functionality (method) from php CLI (which I need for some system batch functionalities) the email is sent, but the images data for attachment (images raw data, related ids and src values modifications) are not included in the email body.
I also tried to force by myself the use of the AddEmbeddedImage method, but the results are the same.
What am I missing? Could you please help me?
I am attaching the email contents outputted by the php cli environment.
Thank you, Andrea
EMAIL CONTENT FROM PHP CLI