locked
sending embedded images in the mail RRS feed

  • Question

  • User916960176 posted

     Hello.

    I'm creating small application written in C# which is going to be used for sending emails from webpage.

    It has 4 textboxes : From, Bcc, Msg, and EmailUrl.

    And now to my problem: When user puts url in EmailUrl textbox the application must send webpage with embedded images.
    Now, i don't want to save all images from that webpage to the disk, but i want to find other solution. I heard that it can be done by storing images in memorystream and then pass it to the Linkedresource but i can't make it work.

    I've created functions for retrieving html, retrieving img urls with complete path (not just i.e. images/image.jpg), sending email etc. .

    Thank you in advance! 

     

    Friday, August 8, 2008 4:34 AM

Answers

  • User916960176 posted

     Hi,

    This is the soln.

    1.Find the image tags in the email body(HTML). 

    2.Request for the image thru the url(got from the 'src' field of the image tag) and read the stream response .

    3.attach the stream to the mailmessage giving it's type and an unique_id.

    4.In the mailbody replace the src field of the image tag with "cid:unique_id".

     

    Thanks,

    Manjunath M. R. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 11, 2008 10:04 AM