bariew / to-swift-mime-parser
临时分支,直到 goetas 修复了 bug
2.1.1
2018-02-20 12:33 UTC
Requires
- php: ^7.1
- swiftmailer/swiftmailer: ^6.0
Requires (Dev)
- phpunit/phpunit: ^4.0|^5.0
This package is auto-updated.
Last update: 2024-09-16 15:41:59 UTC
README
解析通用邮件流,并将其转换为 SwiftMailer 消息对象
安装(composer)
composer requre goetas/to-swift-mime-parser
用法
<?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);