Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7793905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:38:08+00:00 2026-06-01T22:38:08+00:00

We have a forum solution which allows people to submit posts via email. Currently,

  • 0

We have a forum solution which allows people to submit posts via email. Currently, as the mail is parsed, images are just added as attachments to the post. What we would like to do is to parse the email and take embedded images from the mail and turn them into inline images in the output HTML. We need to support any Email client Outlook, Hotmail, Gmail etc

Outlook original Email:

<img id="Picture_x0020_1" src="cid:image001.jpg@01CD172C.038D3C80">

The desired result is that we save out the attachment and have the src as

<img id="Picture_x0020_1" src="http://www.site.com/default.aspx?action=ViewAttachment&paid=594">

I am aware that we can get image through something like: .NET How to extract embedded image from email message?

Do we need to crack open the RegEx or are there libraries that simplify this? I am sure that we aren’t the only people who want to render an Email as HTML

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:38:10+00:00Added an answer on June 1, 2026 at 10:38 pm

    You certainly could go down the road of writing code to extract the embedded images, and modifying the body yourself. It would probably end up being a lot of work tho.

    We use the EasyMail.net from http://www.quiksoft.com/

    Here’s enough to get you started:

    private POP3 pop3 = new POP3();
    pop3.Connect(pop3Address, port);
    var memoryStream = new MemoryStream();
    pop3.DownloadMessage(position, memoryStream);
    var email = new EmailMessage(memoryStream)
    var streamView = new HTMLStreamView(email, urlPrefix);
    string body = streamView.Body;
    int counter = 0;
    
    foreach (Stream stream in streamView.Streams)
    {
        if (counter != 0)
        {
            stream.Position = 0;
            byte[] embeddedObjectBytes = new byte[(int)stream.Length];
            stream.Read(embeddedObjectBytes, 0, (int)stream.Length);
    
            string urlAndCounter = urlPrefix + counter.ToString();
            string uniqueUrlAndCounter = GetUniqueUrl(urlAndCounter);
            if (body.Contains(urlAndCounter + "\""))
            {
              body = body.Replace(urlAndCounter + "\"", uniqueUrlAndCounter + "\"");
            }
            else if (body.Contains(urlAndCounter + " "))
            {
              body = body.Replace(urlAndCounter + " ", uniqueUrlAndCounter + " ");
            }
    
            SaveEmbeddedObject(embeddedObjectBytes,uniqueUrlAndCounter);
        }
    
        counter++;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just setup a wordpress forum and I find that all images are
I'm currently working on my first Django app, which allows registered users to submit
I have a forum where people on a daily basis post links to other
I'm building a solution for a client which allows them to create very basic
I have created a maths library that operates via templates, it allows the user
I have to implement a solution for which I'm not really sure how to
I have a forum at /forum/. My nginx sites-available/ config file has a bunch
I have a discussion forum/blog engine working with web forms. Each post contains html
I have created a forum board app, based on YAML schema found in 'real
i have created a forum using php/mysql and users login through facebook using php

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.