Skip to content

Latest commit

 

History

History
36 lines (29 loc) · 933 Bytes

README.md

File metadata and controls

36 lines (29 loc) · 933 Bytes

EmailForwardParser

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();