E
E
evilelf2018-05-28 12:00:39
gmail
evilelf, 2018-05-28 12:00:39

Yii2. How to fix the problem with sending a picture in the body of the letter?

Hello!
When sending a letter to gmail, the picture is attached to the letter as an attack, but is not displayed in the body of the letter.
On Yandex, everything is fine, the picture is displayed in the body of the letter, it is not in the attack.
How to fix on gmail?
Like this on Yandex (everything is correct)
5mdqobKtkv4Wl2.png
And like this on Gmail (not correct, you need to fix it)
VrwdnPGHOKVebm.png
In Yii, I attach the picture like this:

<img src="<?=$message->embed($_SERVER['DOCUMENT_ROOT'].'/tmp/images/logo-color.svg')?>" alt="logo-color" style="width: 100%;">

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-05-28
@evilelf

It's not just an image, it's an svg. I think the point is that not all email clients eat svg. Try a simple jpg to rule this out or confirm.
But I'm 99.9% sure that it's the svg :
https://css-tricks.com/a-guide-on-svg-support-in-email/
on old technologies. Tables, pictures without transparency, inline styles, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question