gpt4 book ai didi

php - 使用 Swiftmailer 发送多个附件

转载 作者:行者123 更新时间:2023-12-03 01:02:58 27 4
gpt4 key购买 nike

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

最佳答案

是的,只需多次调用 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

关于php - 使用 Swiftmailer 发送多个附件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6118428/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com