Swiftmailer的多个附件 [英] Multiple Attachments with Swiftmailer

查看:253
本文介绍了Swiftmailer的多个附件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个允许上传多个文件的表单。然后将表单域值和附件通过电子邮件发送到某个地址。我使用Swiftmailer生成这些电子邮件。我知道如何使用Swiftmailer附加文件,但是我不知道如何附加多个文件。有人知道这是否可以使用Swiftmailer?

I'm creating a form that allows multiple files to be uploaded. The form field values and attachments are then to be emailed to certain address. I'm using Swiftmailer to generate these emails. I know how to attach a file with Swiftmailer, but I don't know how to attach multiple files. Does anybody know whether this is possible using Swiftmailer?

推荐答案

是的,这只是多次调用 attach()

Yes, it's simply a matter of making multiple calls to attach():

$message->attach(Swift_Attachment::fromPath('../../uploads/hocuradit/' . $attPath . $attA)); 
$message->attach(Swift_Attachment::fromPath('../../uploads/hocuradit/' . $attPath . $attB)); 

资料来源: http://groups.google.com/group/swiftmailer/browse_thread/thread/416b287591dfe931?fwc=1

这篇关于Swiftmailer的多个附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆