If Webform2PDF is used along with mimemail module PDF file is not attached because mimemail needs the $message['attachment'] field to be an array of arrays and not an array of objects.
This is documented in mimemail_prepare_message functions http://api.drupalhelp.net/api/mimemail/mimemail.module/function/mimemail_prepare_message/7.
Webform2PDF instead creates an object at http://cgit.drupalcode.org/webform2pdf/tree/webform2pdf.module#n201.

CommentFileSizeAuthor
#2 fix-mimemail-error.patch1.01 KBdavide.porrovecchio

Comments

davide.porrovecchio created an issue. See original summary.

davide.porrovecchio’s picture

StatusFileSize
new1.01 KB
elsmore’s picture

This did not work for me - PDF appears as base64 code. Let me know if there's a way I can provide more / useful information.

Fernox’s picture

Hi, is this now rectified?
Thanks

pbosmans’s picture

Thanks Davide.
This solved my issue 'Fatal error: Cannot use object of type stdClass as array ...' when i try to send a webform-mail with a pdf attached and mime-mail module enabled.

jeffm2001’s picture

Status: Needs review » Reviewed & tested by the community

This patch works well and should be committed.

@elsmore, I initially had the same confusion as you, with base64 text instead of the attachment. It turns out the solution is to go to the Webform settings (/admin/config/content/webform) and make sure "HTML mail system" is checked. Without this patch you then get a fatal error trying to send, but with the patch you get the attached PDF as expected.

amelio’s picture

+1 for RTBC.

Any chance of getting this committed?

mr.york’s picture

Status: Reviewed & tested by the community » Fixed

Thank you the patch and reviews.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.