Child pages
  • [emails] Folder attachment issue in "m_AttachFile" tag [5.2.2-B1]
Skip to end of metadata
Go to start of metadata

The <inp2:m_AttachFile path="..."/> tag is designed to be called from within e-mail template to be able to attach any file to e-mail, which is being sent right now.

Tag works fine in following cases:

  • the "path" argument value is not empty and file exists - file is attached
  • the "path" argument value is not empty and file doesn't exist - file isn't attached

The case however, that isn't covered is when "path" argument value is empty. In that case it's prepended with DocumentRoot, which is directory, that always exists and attempt is made to attach a directory. That in turn is blocked by e-mail sending code with following error message:

Fatal Error: mail error: the length of the file that was read does not match the size of the part file /path/to/DocumentRoot/ due to possible data corruption in ...\core\kernel\utility\email_send.php on line 1098

Solution

When checking if given file exists also confirm, that it's a file and not a directory.

Related Tasks

INP-1528 - Getting issue details... STATUS