【发布时间】:2022-01-04 06:55:56
【问题描述】:
我一直在阅读的有关 EML 创建的一些问题和文章
- How to verify DKIM signature from an e-mail with openssl?
- PHP library to generate EML email files?
- https://www.icosaedro.it/phplint/mailer-tutorial/index.html
- https://coderedirect.com/questions/25620/php-library-to-generate-eml-email-files(这个很有趣,但需要扩展 DKIM 签名)
- https://www.example-code.com/phpExt/smtp_loadEmlAndSend.asp(仅 SMTP 发送)
- https://community.apachefriends.org/f/viewtopic.php?t=79968&p=270281(这对 Linux 非常有用,但无法找到 Windows 等效项)
- Use of mailtodisk / mailoutput in XAMPP for Linux(很棒的概念)
- https://swiftmailer.symfony.com/docs/introduction.html(这是来自 Symfony 尚未查看是否可以在没有 Symfony 的情况下工作但不再维护)
我似乎找不到任何独立的class 文件来生成*.eml 的内容,这些文件可以存储到文件中(使用file_put_contents)或暂时存储到variable 中。
我的想法是我可以在服务器端创建我的*.eml 文件,我可以使用内容来验证 DKIM 签名,而无需实际发送email。
我确实找到了一个库 phplint 可以满足我的需求,但它对于我的需要来说太大了 (635 Files, 53 Folders 7.84 MB (8,224,768 bytes))。
$m = new Mailer();
$m->setSubject("This is the subject");
$m->setFrom("my@mydomain.com", "My Name");
$m->addAddress("you@yourdomain.com", "Your Name");
$m->setTextMessage("This is the text body of the message.");
$m->sendByStream($out_string, TRUE);
$message_as_string = $out_string->__toString();
上面的sn-p使用下面的classes来生成消息。
[180] => it\icosaedro\email\Mailer
[181] => it\icosaedro\io\IOException
[182] => it\icosaedro\utils\StringBuffer
[183] => it\icosaedro\io\OutputStream
[184] => it\icosaedro\io\StringOutputStream
[185] => it\icosaedro\email\Field
[186] => it\icosaedro\email\MIMEAbstractPart
[187] => it\icosaedro\email\Header
[188] => it\icosaedro\email\MIMEPartMemory
[189] => it\icosaedro\email\EOLFilter
[190] => it\icosaedro\utils\Random
我一直在寻找github 以及PHPClasses。但我无法找到任何与我需要的东西相关的东西(通过足够的研究,我可能可以自己构建它,但我不想重新发明轮子)。
理想情况下,我正在寻找可能的 PHPMailer 扩展,它可以将 EMAIL 流式传输到文件或字符串变量)。我还需要class 或function 来处理linux 和windows。
如果有人能找到图书馆或为我指明正确的方向,我将不胜感激。
【问题讨论】: