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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:51:31+00:00 2026-05-23T20:51:31+00:00

I am writing a simple php script for reading emails. When I extract mail

  • 0

I am writing a simple php script for reading emails.

When I extract mail body with:

imap_body($mbox, $i);

I have returned something like this:

--0016e6db2b334d4d7904a883f4ec 
Content-Type: text/plain; charset=ISO-8859-1 

<The message arrived> 

--0016e6db2b334d4d7904a883f4ec 
Content-Type: text/html; charset=ISO-8859-1 

<The message arrived> 

--0016e6db2b334d4d7904a883f4ec-- 

How can I extract only: ?
I am using php_imap.

Thanks.

  • 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-23T20:51:32+00:00Added an answer on May 23, 2026 at 8:51 pm

    If you are using IMAP, you can use the imap_body() function to read the body.
    PHP has ton of functions that will help you with parsing an email.

    http://www.php.net/manual/en/ref.imap.php

    Check out the fetch_body() function too. It will allow you to get just part of the body.

    http://www.php.net/manual/en/function.imap-fetchbody.php

    For example:

    $message = imap_fetchbody($inbox,$email_number, 1.2);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a PHP script and the script outputs a simple text file log
I'm writing a simple PHP script to access the Foursquare API. The PHP will
I'm writing a simple script to autocomplete when I press TAB. The php script
I'm writing a simple templating layer in PHP but I've got myself a little
I'm writing a simple app that's going to have a tiny form sitting in
I am writing a simple database with web access. I have previous experience with
I'm writing a PHP script to grab text box data from a submitted form.
I'm writing a PHP script that I want to disable from web access (I
I have been writting a keyword search script based on this tutorial: http://www.hackosis.com/2007/11/06/howto-simple-search-engine-with-php-and-mysql/ Like
I'm writing a basic crawler that simply caches pages with PHP. All it does

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.