动态创建 .ics 文件并作为电子邮件附件发送
因此,我有此表单,客户正在询问是否发送包含表单中信息的 .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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ICS 文件只是纯文本文件,因此使用 PHP 生成一个文件很简单: http://en.wikipedia.org/wiki/ICalendar< /a>
生成后,您可以使用 PHPMailer 和 Swiftmailer。没有使用过 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.