0

I am trying to send mail in my ASP.NET Core MVC project. The mail is being sent successfully. But in my "Outlook" account, the picture I added to the image of the mail does not appear. When I send the same mail to my gmail account, the picture appears in the mail.

My markup:

<img src="example.png" width="100%">

I replace the src field in the code.

The view code generated in the mail is:

<img data-imagetype="External" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAEALAAAAAABAAEAAAIBTAA7" originalsrc="example.png" data-imageproxyendpoint="/actions/ei" width="100%">

Instead of the picture I gave in the src field, it says something ridiculous. What is the reason of this?

irmsahin
  • 1
  • 1

1 Answers1

0

Base64 images are not supported by Outlook. You need to attach an image and use the cid attribute in the HTML markup of your message body:

<img src="cid:myImage.png"/>

Where the myImage.png is the filename of the attached file.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • This is not working. This problem still persists. I'm attaching it with a link I got from the official website. Could the problem be related to this? I've tried every method I've seen on the internet but it doesn't work. – irmsahin Apr 19 '22 at 08:04
  • Again, base64 images are not supported by Outlook. Could you be more specific? What link you are attaching? – Eugene Astafiev Apr 27 '22 at 13:38