Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
Can anyone show me the single line code to send image link in mail body,e.g for approve and disapprove can i send images as a link?
Posted

1 solution

Just set the email MailMessage.IsBodyHtml to true, and enter the HTML for the image url in the message body:
HTML
<img style="border: none;" src="http://www.MyDomain.com/Resources/Images/MyImage.png" width="99" height="32" alt="The image cannot be displayed" />



"m sending like,
string app= hyperlink;
and attaching this string in mail body.it works for text but how to use image instead of text like 'click here'?"


Just use the link code round the outside:
HTML
<a href="http://www.MyDomain.com">
   <img style="border: none;" 
        src="http://www.MyDomain.com/Resources/Images/MyImage.png" width="99" height="32"
        alt="Click Here!" />
</a>
Have a look here for a working example: http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_image_link[^]
 
Share this answer
 
v2
Comments
Thanks7872 29-Jan-13 7:13am    
m sending like,
string app= hyperlink;
and attaching this string in mail body.it works for text but how to use image instead of text like 'click here'?
OriginalGriff 29-Jan-13 7:24am    
Answer updated

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