Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to retrive image from SQL and send it in email.
C#
AlternateView htmlView = AlternateView.CreateAlternateViewFromString(message.Body, null, "text/html");
                        LinkedResource logo = new LinkedResource(Server.MapPath(".") + @"\<%# ImageHandler.ashx?ID=CanvasDaddy'%>", "image/gif");
                        logo.ContentId = "<%# ImageHandler.ashx?ID=CanvasDaddy'%>";
                        logo.TransferEncoding = System.Net.Mime.TransferEncoding.Base64;
                        htmlView.LinkedResources.Add(logo);

please help me out.

HTML
<img alt=\"\" hspace=0 src=\'<%# ImageHandler.ashx?ID=CanvasDaddy'%>\' />
if i can use?
Posted
Updated 31-Oct-11 0:34am
v4

1 solution

Hi, as you want to use ASHX Handler this article might server the purpose...

http://kirandangar.wordpress.com/2009/12/01/storing-and-retrieving-images-into-sql-server-2005-using-large-value-data-type-and-http-handler/[^]

Hope this will help you solving the problem...
 
Share this answer
 
v2
Comments
JawadHafiz 31-Oct-11 9:12am    
I just want my html email code backside to reach imagehandler.ashx to get image from sql

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900