开发者

Multiple Attachments with Swiftmailer

开发者 https://www.devze.com 2023-03-08 00:19 出处:网络
I\'m creating a form that allows multiple files to be uploaded.The form field values and attachments are then to be emailed to cer开发者_开发技巧tain address.I\'m using Swiftmailer to generate these e

I'm creating a form that allows multiple files to be uploaded. The form field values and attachments are then to be emailed to cer开发者_开发技巧tain 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?


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)); 

Source: http://groups.google.com/group/swiftmailer/browse_thread/thread/416b287591dfe931?fwc=1

0

精彩评论

暂无评论...
验证码 换一张
取 消