954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Images

I have a images in my local pc.

That is located in "D:\projects\abc\systemimages\123.jpg"

Now i upload image in my template from above location.So it should be shown in my thank u template but when i sent mail with thank you template to another person he/she can't see this images.

Bubbly shah

pooja_shah
Newbie Poster
3 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

hi Bubbly shah,

Absolute path is not possible while displaying an image..

it should be present in your virtual directory aka project directory.

try something like this..

create a folder images in your project...

add your thank you image to that folder..

and on thank you page..

Image1.ImageUrl = "~/Images/Thankyou.png";

please remember absolute path will never work..

hope that helps.

dnanetwork
Practically a Master Poster
Banned
633 posts since May 2008
Reputation Points: 28
Solved Threads: 106
 

No yet it's not working...
Sorry but plz try to understand my code.

pooja_shah
Newbie Poster
3 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

If i understand correctly from your thread then you want to show image with template in your message body when you send to another person. Am i right ? If so then you can't directly attache image in message body. You need to use LinkedResource and AlternetView.

Let's take a look in below line of code..

string strMailContent = "text you want to show in message body";
LinkedResource lr = new LinkedResource(path);
lr.ContentId = "companylogo";
// done HTML formatting in the next line to display my logo
AlternateView av = AlternateView.CreateAlternateViewFromString("<html><body><img src=cid:companylogo/></body></html>" + strMailContent, null, MediaTypeNames.Text.Html);
av.LinkedResources.Add(lr);
mailMessage.AlternateViews.Add(av);


Try by this way and let us know if it's not working ..No yet it's not working...
Sorry but plz try to understand my code.

rohand
Posting Whiz in Training
293 posts since Mar 2010
Reputation Points: 17
Solved Threads: 56
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: