Hello,
- I’m trying to display an image (which is saved in my mediafiles folder which in turn is found at the root folder of my project) inside of a template that is sent as an email.
- But for some reason in the email the image does not get displayed even when the full URL path is set as the value of the src attribute of the img element.
- However, when you use the full URL path of an image from a random site that image will be displayed in the email.
- I’m running the project on my local computer.
- The image will be uploaded by a user when they register their account.
This is the template where I have placed the full URL path of the image found in my mediafiles folder:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Title of the document</title>
</head>
<body>
<h1>This is a heading</h1>
<img src="http://localhost:8000/mediafiles/imresizer-1728264009179_mILhWic.jpg"
style="width: 60px; height: 60px; border-radius: 50%; margin-right: 10px;" />
</body>
</html>
This is the template where I have placed the full URL path of an image I found online:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Title of the document</title>
</head>
<body>
<h1>This is a heading</h1>
<img src="https://cloudfour.com/examples/img-currentsrc/images/kitten-large.png" style="width: 60px; height: 60px; border-radius: 50%; margin-right: 10px;" />
</body>
</html>
Comparison of emails (the one on top is the result of using the URL of my image and the one on the bottom is the result of using the URL of the random sample image I found online):
Any help is much appreciated !