Attaching PDF file to email on Magento 2

In Magento 2, The lib/internal/Magento/Framework/Mail/Template/TransportBuilder Class takes responsibility for preparing and sending email, but it's still lacking a method for attaching PDF files. However, since the TransportBuilder Class uses Message class, which inherits from \Zend_Mail, we are now able to add attachments programmatically. Here is how we do it. Step 1: Create TransportBuilder Class Step [...]