Skip to content

PHPMailer - Limit email attachments by file size and file type #2880

Answered by Synchro
Zigii asked this question in Q&A
Discussion options

You must be logged in to vote

You also asked this question on Stack Overflow, and the comments there tell you what you're doing wrong. In particular, you're attempting to add the files regardless of whether they match your criteria or not, and you're sending the message every time around the loop, which will result in multiple messages, each one with one more attachment than the last. Look at how the original script you based this on works.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Zigii
Comment options

Answer selected by Zigii
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants