messaging_phpmailer/messaging_phpmailer.module | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/messaging_phpmailer/messaging_phpmailer.module b/messaging_phpmailer/messaging_phpmailer.module index af7ccc8..22940e4 100644 --- a/messaging_phpmailer/messaging_phpmailer.module +++ b/messaging_phpmailer/messaging_phpmailer.module @@ -249,10 +249,14 @@ function messaging_phpmailer_drupal_mail($message) { if (!empty($message['attachments']) && variable_get('messaging_phpmailer_attach', 0)) { foreach ($message['attachments'] as $attachment) { - $mail->AddAttachment($attachment->filepath, $attachment->filename, 'base64', $attachment->filemime); + if (isset($attachment->string)) { + $mail->AddStringAttachment($attachment->string, $attachment->filename, 'base64', $attachment->filemime); + } + else { + $mail->AddAttachment($attachment->filepath, $attachment->filename, 'base64', $attachment->filemime); + } } } - // If enabled debug option, log everything... if (variable_get('messaging_phpmailer_debug', 0)) { $mail->SMTPDebug = TRUE;