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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:45:41+00:00 2026-06-15T10:45:41+00:00

I am using this absolute amazing piece of code: https://github.com/plancake/official-library-php-email-parser/blob/master/PlancakeEmailParser.php But the one thing

  • 0

I am using this absolute amazing piece of code: https://github.com/plancake/official-library-php-email-parser/blob/master/PlancakeEmailParser.php

But the one thing it is missing is the ability to get the From email address.

I have simple added:

public function getFromEmail()
{
    if (!isset($this->rawFields['from']))
    {
        return false;
    }

    return $this->rawFields['from'];
}

But how would I get only the email address part at the moment it returns: John Smith<john@gmail.com>?

Also I would need this to work if the From address was only john@gmail.com?

Thanks to the answers this was the finished code:

public function getFromEmail()
{
    $email = trim($this->rawFields['from']);

    if(substr($email, -1) == '>'){
        $fromarr = explode("<",$email);
        $mailarr1 = explode(">",$fromarr[1]);
        $email = $mailarr1[0];
    }

    return $email;
}
  • 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-15T10:45:42+00:00Added an answer on June 15, 2026 at 10:45 am
    $mailid='John Smith<john@gmail.com>';
    $mailarr=explode("<",$mailid);
    $mailarr1=explode(">",$mailarr[1]);
    $just_emailid=$mailarr1[0];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

using this https://github.com/jonthornton/jquery-timepicker demo here: http://jonthornton.github.com/jquery-timepicker/ on a rails 3.2 app trying to use
Using this page, http://developer.android.com/sdk/compatibility-library.html , I have installed the Android Support Package, added a
Using this piece of code in the head of a page: <script type=text/javascript> function
I'm using this code to get data using cURL $url='http://example.com/'; //URL to get content
I'm using this script ( http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/ ) to valdate my form etc, which also
I am using this form validator (http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/) and am having issues getting it to
Iam using this Formplugin engine for Validation http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/ it has method such as noSpecialCaracters
http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/ Iam using this form plugin.where we can call Separate function inorder to do
at the moment i'm using this validation plugin: ( http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/ ) but when it
I'm using this code: <div id=m1 class=drag; title=CARS style=position:absolute; left:0px; top:0px; width:32px; height:32px;> <img

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.