Hello,

I'm running Drupal 7.43 with Mass Contact and Mime Mail.

I'm able to send attachments, but I'm receiving destroyed file with just 1KB file. It doesn't matter which kind of file.
I was searching for hours for the reason, but I don't have any more ideas.

The problem appeared with an update of Drupal Core to 7.43..

Please help me :)

Comments

jweidemann created an issue. See original summary.

designotb’s picture

I have actually encountered the same problem.

designotb’s picture

The content of the file appears to be the URI of the tmp directory that was created while uploading, but doesn't appear to grab the final file to attach to the email.

designotb’s picture

In mass_contact.page.inc the following needs to be changed as this function is actually performed within mimemail.inc.

            // Save the file information for the message.
            $files[] = array(
              'filepath' => drupal_realpath($file->uri),
              'uri' => drupal_realpath($file->uri),
              'filename' => $_FILES['files']['name']['attachment_' . $i],
              'filemime' => $_FILES['files']['type']['attachment_' . $i],
            );

CHANGE TO

            // Save the file information for the message.
            $files[] = array(
              'filepath' => $file->uri,
              'uri' => $file->uri,
              'filename' => $_FILES['files']['name']['attachment_' . $i],
              'filemime' => $_FILES['files']['type']['attachment_' . $i],
            );

I'll work on getting a patch added to DEV in the next few days, but this fixed it on my site.

designotb’s picture

or view the patch on this issue:

https://www.drupal.org/node/2423647

oadaeh’s picture

Assigned: jweidemann » Unassigned
Status: Active » Closed (duplicate)