Murray Brown
asked on
ASP.net Include image in body of email (System.Net.Mail)
Hi
I am trying to include an image from the Resources folder of my ASP.net website in the html body of my email.
The first line below, which gets an image from another site worked, but the second line, where I try to get the images from my site resources didn't
oHBody = oHBody & "<img src=""http://www.beansoftware.com/Images/Logo.jpg"" alt=""Logo"" "
Dim oImagePath As String = Server.MapPath("~/Resource s/Q.jpg")
oHBody = oHBody & "<img src=""" & oImagePath & """ alt=""Logo"" "
I am trying to include an image from the Resources folder of my ASP.net website in the html body of my email.
The first line below, which gets an image from another site worked, but the second line, where I try to get the images from my site resources didn't
oHBody = oHBody & "<img src=""http://www.beansoftware.com/Images/Logo.jpg"" alt=""Logo"" "
Dim oImagePath As String = Server.MapPath("~/Resource
oHBody = oHBody & "<img src=""" & oImagePath & """ alt=""Logo"" "
ASKER
I get Error 'HostingEnvironment' is not declared.'
missing the namespace probably: System.Web.Hosting.Hosting Environmen t.MapPath
ASKER
Hi. Sorry I figured that part out. This is the code I use to build the html but iy doesn't work
Dim oImagePath As String = System.Web.Hosting.Hosting Environmen t.MapPath( "~/Resourc es/Q.jpg")
oHBody = oHBody & "<img src=""" & oImagePath & """ alt=""Logo"" "
Dim oImagePath As String = System.Web.Hosting.Hosting
oHBody = oHBody & "<img src=""" & oImagePath & """ alt=""Logo"" "
more details please?
what is the value of oImagePath?
what is the value of oImagePath?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks very much for the help
Give a try to
Open in new window
more details at http://codeconsults.com/map-path/