【发布时间】:2014-07-09 02:05:48
【问题描述】:
我想加载几封保存为 txt 文件的电子邮件并使用 swiftmailer 发送它们。 txt文件是这样的
Received: (qmail 17484 invoked from network); 1 May 2014 03:38:08 -0000
Received: from localhost (localhost [127.0.0.1])
by myserver.example.com.dyndns.org ([192.168.1.2]); 01 May 2014 03:38:08 -0000
Received: from otherserver.example.net ([127.0.0.1])
by localhost ([127.0.0.1])
with SMTP via TCP; 01 May 2014 03:38:08 -0000
Received: (qmail 4822 invoked from network); 1 May 2014 03:38:07 -0000
Received: from blablabla.example.org ([103.123.123.11])
by otherserver.example.net ([123.123.6.152])
with ESMTP via TCP; 01 May 2014 03:38:07 -0000
To: <me@example.com>
Date: Thu, 01 May 2014 12:37:29 +0900
From: <someone@example.org>
Subject: Awesome subject of email
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-2022-JP
Fantastic email text
我在 Swift_Message 类中找不到 from_string 方法。解析 txt 文件并使用解析的信息创建一个新的 Swift_Message 对象是唯一的解决方案吗?
【问题讨论】:
-
这不是完全重复的,因为您专门询问 SwiftMailer,但请看一下这个问题:stackoverflow.com/q/5044194/1237411
-
不是 swiftmail 解决方案,但可以解决您的问题:“给定一封电子邮件作为原始文本,我如何使用 PHP 发送它?” stackoverflow.com/questions/6632399/…
标签: php email swiftmailer