Inline Images in email format are not loaded

Hi, I’ve been trying to send images inline in email notifications but the images won’t load and I can see a small white box which points to this link where the images is stored in (mysite)/files/images

In the emails being sent out. How can I send the images inline in the email to customers.

I read somewhere about the security firewall or something but I have no idea about it and how will it help, alternatively I found this link for a fix about it but I’m not sure if this will help or not!

Experts please help!
Thank You

I am having the same issue.

Is no one else experiencing it?

Try using a secured server for sending images. Like your instance should be https://(yourerp)
and not http://(yourerp). This is the solution for the issue. Also try to provide full path to images rather than absoulute path.

1 Like


Please excuse the ill mannered delay, I did not notice your reply until this morning. I am grateful for the clues as to how to proceed.

So …

In my MariaDb record I see the image URI is <img src="/files/SNGgKoL.jpe">

"SELECT subject, sender_full_name, recipients, communication_type, content
  FROM `_a7a7e96ba1644fd9`.tabCommunication":
		"subject" : "Try image 2019\/12\/13 07:03",
		"sender_full_name" : "Administrator",
		"recipients" : ", ",
		"communication_type" : "Communication",
		"content" : "<div><img src=\"\/files\/SNGgKoL.jpe\"><\/div>"

Meanwhile in the recipient’s copy viewed in Gmail that same line is translated as :

<div><img src=3D"http://ib_erp.local/files/SNGgKoL.jpe"></div>

The problem is that the name I used to define my site is …


… whereas my endpoint URL is (for example)

I tested secure and insecure URLs: & and can confirm that the image file is accessible at both those addresses.

Questions :

Does there exist a setting to redefine that URI from http://ib_erp.local/files to

Is it obligatory to name the site exactly the same as the public domain name? (that’d really, really suck!)

Is there a way to prepare an HTML email body manually?


I solved the problem:

I made two changes in my site configuration and two changes in my nginx configuration:


├── frappe-bench
│   ├── config
│   │   ├── nginx.conf
│   └── sites
│       ├── currentsite.txt
│       └── ib_erp.local


├── frappe-bench
│   ├── config
│   │   ├── nginx.conf
│   │   ├── nginx.conf_bk20191213_1023
│   └── sites
│       ├── currentsite.txt
│       ├── currentsite.txt_bk20191213_1022
│       └──


I renamed my site directory, and changed the contents of currentsite.txt from …


… to …

I also change two lines in nginx.conf

The external to internal name mapping from …

map $host $site_name_mnaixys { ib_erp.local;
        default $host;

… to …

map $host $site_name_mnaixys {;
        default $host;

I also renamed the virtual server block …

server {
        listen 80;

… to …

server {
        listen 80;

I’m not certain of the correct way to restart ErpNext, and I’m working on a development VPS, so I just gave it the three finger salute. You might want to do something boring and timid like backup first.

Hi, now that we have the solution how can we close this issue. I’m sorry I’m pretty new to this whole thing as well.

So that worked for you?

Hi yes changing from http to https worked for the images. Also I uploaded the images to files list and gave a full path for every image like <img = … https://myerp/files/image_name>
Thank You so much

Oh cool!

Since you posed the original question, I believe you can mark it solved by returning to that post, where you should see a “solved” button.

Ooops. Wrong.

You should see a “Solution” button at the bottom right of the post that solved it.

Thank You so much, I’ve marked the solution.

In frappe 13.26.1 embedding images inline in emails is very easy:

def send_email_with_embedded_images():
    message = """
            <p>Bild aus /assets: <img embed="assets/erpituc/images/ITUC Logo.png" alt="ITUC-LOGO aus /assets" /> </p>
            <p>Bild aus /files: <img embed="files/ITUC.png" alt="ITUC-LOGO aus /files"> </p>
    # Files are here:
    # /home/frappe/frappe-bench/apps/erpituc/erpituc/public/images/ITUC Logo.png
    # /home/frappe/frappe-bench/sites/

    print("E-Mail gesendet")

May work in older versions of frappe too.
Using <img embed='...'> in Notifications works too.

Result looks like this: