I am using Magento version 2.2.6 and trying to send custom email with attachment, but I am getting 500 error. I tried transportbuilder addattachment which is working in Magento 2.3.x and onwards. But facing issue in this version.
I am trying this code:
$this->message->createAttachment( $pdfString, 'application/pdf', \Zend_Mime::DISPOSITION_ATTACHMENT, \Zend_Mime::ENCODING_BASE64, 'attatched.pdf' );
And getting this error : https://i.stack.imgur.com/civfS.png
Kindly let me know how I can send email with attachment in Magento version 2.2.6.
Any help will be apperciated.