When attaching text/plain file, SmtpMailSystem treats it as text/plain, not as attachment:
Content-Disposition: attachment;filename="file.txt"
Content-Type: text/plain;name="file.txt"
Content-Transfer-Encoding: base64
...
Solution I found at the moment: in smtp.mail.inc change position of whole block
elseif (strpos($body_part, 'Content-Disposition: attachment;')) {
after first block:
if (strpos($body_part, 'multipart/alternative')) {
Comments
Comment #1
miqmago commentedAlso another 2 problems detected for drupal 7:
$attachment_new_filename needs to be wrapped with temporary://...
Also file_save_data returns a stdClass object, not a string.
Originally:
Needs to be:
Comment #2
simon georges commentedThe #1 should be fixed by this commit, so it's a duplicate of #1442514: Sending attachments using modules smtp and mimemail. Please target a specific problem when you create an issue.
Let's see about the problem indicated by the title of the issue.
Comment #3
simon georges commentedCould you eventually test the (soon to be released) -dev version, as a few things have been fixed since then?
Comment #4
wundo commentedClosing very old (dead) issues, if you think this is still relevant please re-open.