Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to insert image into email template

I'm trying to use the PasswordRecovery of ASP.NET.

Everything works fine, however I am using Email template. Within this email I'm trying to insert an image as follows:

<html xmlns="http://www.w3.org/1999/xhtml">

<body>

<img alt="blabla" src="/Images/blabla-logo.png" align="middle"/><br/><br/>
bla bla:<%Password%><br /><br />
</body>

</html>

As I said, the email is being sent fine but the image is not inserted. I tried: src="~/Images/blabla-logo.png", but with no success.

Idea anyone?

Thanks a lot, Assaf.

like image 789
Assaf Avatar asked Oct 25 '22 11:10

Assaf


1 Answers

For email you should not give relative path like "/Images/blabla-logo.png" the only works for the internal website pages, instead of this you should give the complete path like

http://youserver/youapp/Images/blabla-logo.png

I will suggest you not to include image using the path instead of this try embedding the image in your email. You can achieve this by converting your images to base64 string and set the base64 string as the source of the image.

like image 73
PSK Avatar answered Nov 01 '22 11:11

PSK