I am trying to create an img
tag in code-behind and send it in email (in the body of the email not as attachment).
body += "<p><img src='" + imageUrl.Remove(0,2) + "' alt='Product Image' width='250px' height='250px' runat='server' /></p>";
NB: I have declared body
as string and I am adding other HTML controls to it (e.g p,h1,li etc).
The imageUrl
variable returns "~/Images/bag/name_of_image.jpg" hence I am removing the first two characters which are ~/.
It seems like it is creating the image but its not displaying in the email body.