aistis- / to-swift-mime-parser

Parse a generic mail stream, and convert it to a SwiftMailer Message http://swiftmailer.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

to-swift-mime-parser

Parse a generic mail stream, and convert it to a SwiftMailer Message object

Build Status Code Coverage Scrutinizer Code Quality

Installing (composer)

composer requre goetas/to-swift-mime-parser

Usage

<?php

$parser = new \Goetas\Mail\ToSwiftMailParser\MimeParser();

// read a mail message saved into eml format (or similar)
$inputStream = fopen('mail.eml', 'rb');

$mail = $parser->parseStream($inputStream); // now $mail is a \Swift_Message  object

// edit the email
$mail->setFrom("me@you.it");
$mail->setTo("me@you.it");
$mail->setSubject("New Subject");


// optionally loop through mail parts (and edit it!)
// $mail->getChildren();

// send a new mail
$mailer->send($mail);



About

Parse a generic mail stream, and convert it to a SwiftMailer Message http://swiftmailer.org/

License:MIT License


Languages

Language:PHP 100.0%