2

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

Edited by pooja_shah: ok

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by rohand
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.

0

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

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/><br></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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.