jeremymarc/email-forward-parser

Parse forwarded email

dev-master 2013-06-28 21:42 UTC

This package is not auto-updated.

Last update: 2024-11-19 07:11:41 UTC


README

Build Status

This is a small PHP library to parse forwarded email content, inspired by EmailReplyParser.

Installation

If you don't use a ClassLoader in your application, just require the provided autoloader:

<?php

require_once 'src/autoload.php';

Usage

Simply call the read method with the email content like this:

<?php
    $email = EmailForwardParser::read($body);
    $from = $email->getFrom();
    $to = $email->getTo();

    $fromName = $from['name'];
    $fromEmail = $from['email'];
    $toName = $to['name'];
    $toEmail = $to['email'];
    $date = $email->getDate(); //DateTime
    $subject = $email->getSubject();
    $body = $email->getBody();