【问题标题】:Generate EML file for DKIM Signatue为 DKIM 签名生成 EML 文件
【发布时间】:2022-01-04 06:55:56
【问题描述】:

我一直在阅读的有关 EML 创建的一些问题和文章

我似乎找不到任何独立的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 流式传输到文件或字符串变量)。我还需要classfunction 来处理linuxwindows

如果有人能找到图书馆或为我指明正确的方向,我将不胜感激。

【问题讨论】:

    标签: php email github eml


    【解决方案1】:

    我想我已经通过https://symfony.com/doc/current/mailer.html 找到了我一直在寻找的东西

       $email = (new Email())
            ->from('hello@example.com')
            ->to('you@example.com')
            //->cc('cc@example.com')
            //->bcc('bcc@example.com')
            //->replyTo('fabien@example.com')
            //->priority(Email::PRIORITY_HIGH)
            ->subject('Time for Symfony Mailer!')
            ->text('Sending emails is fun again!')
            ->html('<p>See Twig integration for better HTML integration!</p>');
    
        echo "<pre>";
        print_r($email->toString());
        echo "</pre>";
    

    虽然我仍在寻找一个单一的类解决方案,而不是下载一个英国媒体报道来完成一项任务。

    【讨论】:

      猜你喜欢
      • 2014-07-20
      • 1970-01-01
      • 1970-01-01
      • 2012-02-05
      • 2019-02-23
      • 2014-07-13
      • 2018-08-10
      • 1970-01-01
      相关资源
      最近更新 更多