S
S
smithana2018-04-18 12:43:00
css
smithana, 2018-04-18 12:43:00

How to insert pictures into email layout not from the server, but directly into the letter itself?

Hello everyone
A couple of times I made up letters and inserted pictures with links from the server

<img style="width:200px;Height:100px" src="http://mysite.ru/my-pic.jpg">

everyone was happy with everything, but in the new layout they asked to embed pictures directly into the letter itself.
As I understood blob nobody uses for these purposes.
base64 yes.
<img src="data:image/png;base64,... />
but this option blocks gmail and some other clients.
in an article on Habré
https://habrahabr.ru/company/sibirix/blog/114472/
I saw that if you specify the absolute path src="y:\temp\mailing\header.jpg", then the picture will be embedded in the letter itself.
But since I am not engaged in mass mailing, but only send a test letter, then I send it from the server. Those. I write a php file with a mail function, upload it to ftp, call it through the browser, it is executed and the letter flies to the mail.
In this case, I cannot specify src="y:\temp\mailing\header.jpg". I tried to specify something like src="/home/user/public_html/emails/header.jpg", but in this case the letter comes to the mail without pictures at all.
Accordingly, the question is, how can I insert a picture directly into a letter when sending from a server, or how can I send a letter from a local computer to indicate the path as in the Habr article?
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2018-04-18
@webinar

attachment has a cid, you can paste it:
https://stackoverflow.com/questions/4312687/how-to...

D
DENIS Kokorev, 2018-06-13
@shmaroder

Upload pictures to your server mydomen.ru/imgformail/header.jpg for example, and write this absolute path to it in src.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question