goetas/to-swift-mime-parser

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

Maintainers

👁 goetas

Package info

github.com/goetas/to-swift-mime-parser

pkg:composer/goetas/to-swift-mime-parser

Statistics

Installs: 44 873

Dependents: 2

Suggesters: 0

Stars: 12

Open Issues: 2

2.3.0 2021-03-07 19:52 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 5d0523e7e883be39a0efa8a1f0f083ec69aa7f62

  • Asmir Mustafic <goetas.woop@gmail.com>

mailmimeswiftswiftmailer

This package is auto-updated.

Last update: 2026-06-08 07:27:57 UTC


README

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