动态创建 .ics 文件并作为电子邮件附件发送

发布于 2024-12-13 03:09:59 字数 161 浏览 3 评论 0原文

因此,我有此表单,客户正在询问是否发送包含表单中信息的 .ics 文件。每次都会动态创建该文件,并作为动态创建的电子邮件中的附件发送。

所以我的问题是双重的。第一,您可以即时创建 ICS 文件吗?第二,您可以将其作为附件发送吗?

顺便说一句,这是一个 PHP 5.xx 环境。

So I have this form and the client is inquiring about sending an .ics file with the information from the form. This would be dynamically created every time and sent as an attachment in a dynamically created e-mail.

So my question is twofold. One, can you create an ICS file on the fly and two, can you send it as an attachment?

It's a PHP 5.x.x environment by the way.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

归属感 2024-12-20 03:09:59

ICS 文件只是纯文本文件,因此使用 PHP 生成一个文件很简单: http://en.wikipedia.org/wiki/ICalendar< /a>

生成后,您可以使用 PHPMailerSwiftmailer。没有使用过 swiftmailer,但我知道 PHPMailer 有一个从变量而不是文件创建附件的功能。

ICS files are just plaintext files, so it's trivial to generate one with PHP: http://en.wikipedia.org/wiki/ICalendar

Once you've generated it, you can trivially do mail attachments with PHPMailer and Swiftmailer. Haven't used swiftmailer, but I do know PHPMailer has a function to create attachments from a variable, not a file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文