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 9268749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:56:19+00:00 2026-06-18T14:56:19+00:00

I receive email from POP3 server with PHP. I have a raw string containing

  • 0

I receive email from POP3 server with PHP. I have a raw string containing headers and body. How can I get headers and body parsed in form of a class or array?

Example of what I have:

Return-path: Envelope-to: x@x.de Delivery-date:
Wed, 06 Feb 2013 09:35:37 +0100 Received: from mail by
host6.toxpress.com with spam-scanned (Exim 4.80.1) (envelope-from ) id
1U30Tc-0003sH-LQ for x@x.de; Wed, 06 Feb 2013
09:35:36 +0100 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06)
on host6.toxpress.com X-Spam-Level: X-Spam-Status: No, score=-1.9
required=5.0 tests=BAYES_00,FREEMAIL_FROM,
RCVD_IN_DNSWL_NONE,TVD_SPACE_RATIO autolearn=ham version=3.3.2
Received: from moh3-ve2.go2.pl ([193.17.41.86] helo=moh3-ve1.go2.pl)
by host6.toxpress.com with esmtp (Exim 4.80.1) (envelope-from ) id
1U30Tc-0003rk-2b for x@x.de; Wed, 06 Feb 2013
09:35:32 +0100 Received: from moh3-ve1.go2.pl (unknown [10.0.0.157])
by moh3-ve1.go2.pl (Postfix) with ESMTP id BC734AF611B for ; Wed, 6
Feb 2013 09:34:31 +0100 (CET) Received: from unknown (unknown
[10.0.0.108]) by moh3-ve1.go2.pl (Postfix) with SMTP for ; Wed, 6 Feb
2013 09:34:31 +0100 (CET) Received: from
43.dynamic.chello.pl [89.69.42.127] by poczta.o2.pl with
ESMTP id jtIGfv; Wed, 06 Feb 2013 09:34:31 +0100 Message-ID:
<51121593.3090008@o2.pl> Date: Wed, 06 Feb 2013 09:34:27 +0100 From:
Tomasz Reply-To: tomasz_smykrowski@o2.pl Organization: Tomasz
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:20.0) Gecko/20100101
Thunderbird/20.0a2 MIME-Version: 1.0 To: x@x.de
Subject: adaads Content-Type: text/plain; charset=ISO-8859-1;
format=flowed Content-Transfer-Encoding: 7bit X-O2-Trust: 2, 64
X-O2-SPF: neutral dsadasdsaas .

And what i want to be able to do:

echo $from;
echo $replyTo;
echo $date;
echo $body;
echo $subject;
echo $charset;
  • 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-18T14:56:21+00:00Added an answer on June 18, 2026 at 2:56 pm

    Have a look at the MIME E-mail message parser class.
    According to the author’s description:

    This class can be used to parse and decode MIME e-mail messages. It
    supports decoding single RFC 2822 MIME messages or archives that
    aggregate multiple messages in the mbox format. The decoded message
    data is returned as an array that describes one or more messages found
    in a message file or data string
    . The bodies of multipart messages can
    be decoded into distinct sub-messages. The message body data can
    decoded and saved to separate files, so the class can handle messages
    larger than the available memory.

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

Sidebar

Related Questions

I can successfully receive email from SendGrid and process its data. My problem is
greetings all i have a problem that when sending an email from the server
I have a section of code that sends email from SMTP server. The code
I receive my email from postmaster@domain.co.uk instead of the $email I specified. the php
How can I receive Email with Microsoft Azure? Yes, I know the instruction from
1) Can I automatically receive an email from my Drupal website when new updates
I just received an email from our host and they've upgraded our PHP to
I create an application that gets email from mail server. I use System.Net.Mail.MailMessage for
I have a e-mail driver. It get a list of e-mail accounts and receive
I'm using post-receive-email hook from the Git distribution to send e-mails to certain users

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.