When calling mimemail() by code more than once in the same request, if each call create attachments to the message (for example for images in the HTML body), the attachments of the first message are being copied to the second one, and then copied to the thirst one, and so on.
This happens because the _mimemail_file() function uses a "static" array to hold all attachments in a single message. The problem is that the array doesn't get reset when working in a new message.
The fix is quite simple. We just need to reset the array in the _mimemail_file() function. Just replace the list line of that function:
return $files;
With:
$returnFiles = $files; // Cache the files array.
$files = array(); // Reset the files array for successive requests.
return $returnFiles; // Return the cached array.
Regards,
Frederico Caldeira Knabben
----
http://www.fckeditor.net
"Support Open Source Software"
Comments
Comment #1
allie mickaFixed. Thanks so much for such a descriptive issue!
Comment #2
(not verified) commented