Problem with email template attachment

Hi to all, i have a strange issue with the template email.

i’ve tryed to attach a document in a template email, for example a pdf.
In this case it works fine and save correctly the file.

then i go on my client and try to send the email with the attachment. Sadly when the email arrive, there are an attachment without any extension and he has the name of the id of the document on the Database. Is there a way to fix this?

find a way to get to fix this. on Email.php in the module, on line 3104 there is the function

$mail->AddAttachment(
                $file_location,
              $locale->translateCharsetMIME(trim($filename), 'UTF-8', $OBCharset),
                'base64',
                $mime_type
            );

in this function the translateCharset kills the filename variable. and when the mailer try to attach the file, there is no name, so it puts the id. i’ve removed the translate and now it works.

Nice find!

did you try with file names with accented characters? That function is probably there for a reason… maybe it should be fixed instead of removed…

even with “report.xml” it doesn’t work. so, i have not a lot of time to test out and i fixed like that. btw i have an old crm version too, and it has the same problem (7.9.11)