Web Analytics

Fill the form & Get Installation Support

Magento 2 Add file Attachment in email using custom module

If you want to implement “add file attachment in the email” functionality in Magento 2, then please follow the below step.

Step 1) Create Vendor/Module/etc/di.xml

Step 2) Please create the email template in Vendor/Module/view/frontend/email/email_template.html
then after calling this file to Vendor/Module/etc/email_templates.xml

Step 3) CreateTransportBuilder and extend with \Magento\Framework\Mail\Template\TransportBuilder

Create Vendor/Module/Model/Mail/TransportBuilder.php

Step 4) Send mail using controller in execute method
Create Vendor/Module/Controller/Index/Index.php


Fill the below form if you have any Magento programming need.

    Recent Articles

    Author Info

    Hire s. dutt

    Get a Free Quote

      /* second popup */

      Connect With Us