When dealing with attachments using PHP, there is a filename and a temporary filename for each file. The way Mime Mail adds attachments, one can only give one of those as the file. If the file is only really represented by the temporary filename, then that is what must be passed to the function and that is the name that will be displayed to the end user. (Better documentation would have saved me hours of time trying to figure all this out.) The attached patch gives a third parameter to _mimemail_file() so that the actual name of the file may be specified along with the file, if desired, and if not, the default behavior is used.
I'm pretty sure this won't break any existing module's code, since, AFAICT from a scan of the modules in CVS, no one is using Mime Mail with attachments.
I did roll this against the 5.x branch, as that's the one I'm using, but I can create a HEAD version as well, if desired.
I will be using this in the Mass Contact module and pointing people to this patch, unless a better solution comes along.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | mimemail.inc_.patch | 1.43 KB | oadaeh |
| mimemail.inc_.patch | 1.46 KB | oadaeh |
Comments
Comment #1
oadaeh commentedAn updated patch to take into account other changes in the module.
It's still against the DRUPAL-5 branch.
Comment #2
jerdavisCommited to HEAD - Thanks!
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.