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

  • SEARCH
  • Home
  • 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 3480654
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:22:26+00:00 2026-05-18T10:22:26+00:00

I am working on an application which connects to the mail server using python

  • 0

I am working on an application which connects to the mail server using python POP3 library parses the emails and put them into database.

I have successfully parse the text emails, html emails and attachments. Now, I am stuck with the emails which contain embedded images with the emails. Server is howing CID: some code for the images in the src tag and the image is in the bytes. I am not sure how to get the images and map them with the CIDs.

Please suggest.

Thanks in advance.

below is the email content which I am getting:

Content-Type: multipart/alternative; 
               boundary="PHP-alt-e0af773d09fadf5208f69aecffcb4de888824263"

 --PHP-alt-e0af773d09fadf5208f69aecffcb4de888824263
 Content-Type: text/plain

 Hi, testing embedded images email!


 --PHP-alt-e0af773d09fadf5208f69aecffcb4de888824263
 Content-Type: multipart/related; boundary="PHP-related-e0af773d09fadf5208f69aecffcb4de888824263"

 --PHP-alt-e0af773d09fadf5208f69aecffcb4de888824263
 Content-Type: text/html

 <html>
 <head>
 <title>Test HTML Mail</title>
 </head>
 <body>
 <font color='red'>Hai, it is me!</font>
 Here is my picture: 
  <img src="cid:PHP-CID-e0af773d09fadf5208f69aecffcb4de888824263" />
 </body>
 </html>

 --PHP-related-e0af773d09fadf5208f69aecffcb4de888824263
 Content-Type: image/gif
 Content-Transfer-Encoding: base64
 Content-ID: <PHP-CID-e0af773d09fadf5208f69aecffcb4de888824263> 

 iVBORw0KGgoAAAANSUhEUgAAAEYAAAAgCAMAAACYXf7xAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ
bWFnZVJlYWR5ccllPAAAAwBQTFRF////oNKWY6ZZTnc08/304+P/6/PsRHgpZYpWGHcTWqFWe7pz
WZNFwNa+Q2UqgpZ5JGcZ4ezj7e3/6Oj/tbW62tr/aadiK1sSUHQ6oKeSI0UM5PHkAAAAaZhifHx6
yMjKWHdJY5lbi6yFW5RU0+LSnq2VmZ6Mm8iS8vL/dXVzRERFJVUJrNalcrNtkZGRLnYslsWJ3e3d
7fXwstirWYJB3ergyeTI9vb/iIiIgoKBd6V0np6ce51rU2pDqMqlVVVWTnpFhcN7NTU2RYUqpbWd
rKysOHcn5vbql6eOMWYbMkUi+fn/uOStk6yLZGRm7f7tlLGKOXg20dvNIiIiGUUER4Q0InMcaYtf
3+/e3d3czd7KjY2Nnb6WtdOzKWkmhoaGUJNNjL+FhLt7jLp9IF0Z/v7/0tLRqrijVX9UTmZA+v38
Qko5SW5EVYA9JkwPMzwocnJub7RnfZpy3vPcaGhkhYWDbm5rhISIRoZGN0gxm6aQ/Pz/OYAyXm1V
pKSpeHh2Q1M5oqKgiaZ+dZ1vbqRaTVU4k7GFe6xqpr6c1+rb3uTcfcdx0d3Qk7ePhaJ6cqVsTp5H
xNzA1ezTVotS7e7uv968+v76xtPBPlczm7OVydfDdK1t+fn7+vT91NTddpRpVmNBlLyUgKRymZmW
u9a5dati9vr35eXugrFzTVY2/v//R5M5ial+zdbJcJJn8/jz+f73SV89EREReL1vob2TUVw7orGX
YmtU///+YYZNkaKGmdKUR106iIiD9/b5VWxNmbWOudy0j4+N+//9/v/8Dw8Pd5xnf3+INF8Yjp2D
frZ2cHB30ufZb3Bt2+HY3e3WqKqiLjcrUW09q8+xLmowOXAhmbiI4+Xnjr6P5O/n5/DkeK9mQEBE
8vf5//r/9fT4U5Q9hcqGlNKNDh0FlJSXA0UAC1cJGl0KWaZQwc69yN3K/f76drVuQn0iLTkZeJds
lq+Pv9HBN1YtV21Fkb6Bkb6KmLSHtNC5t9y5DikEhLZ/W3BLMEoddqVi4vfk////U8M4kgAAAQB0
  • 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-05-18T10:22:26+00:00Added an answer on May 18, 2026 at 10:22 am

    Fixed the issue by checking the Content-Disposition value and cid in the contents.

    If its attachment the file contents should be shown as attachments with the email and if its inline the contents will be shown in the body.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.