Is it possible to send multiple email attachments with zend_mail?
-
13-07-2021 - |
Question
I found several examples of sending a single email attachment using zend_mail. But I cannot figure out how to send multiple attachments. Can someone share how to do this if it is possible. I have sendmail installed on the server.
Solution
Yes its possible to send more than one attachment in a Zend_Mail_Message
.
Depending on what method you use for creating attachments, just call $mail->createAttachment()
once per attachment, or create all of your attachments as Zend_Mime_Part
objects and call $mail->addAttachment($part)
once for each attachment.
See Zend Mail Attachments for examples. Just repeat the example once for each file you want to attach.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow