hello everyone i am sending mail to admin form details it is

Getting error : Email template 'customemail_email_template' is not defined.

The link i have referred : http://www.codextblog.com/magento-2/sending-custom-emails-using-custom-module-in-magento-2/

2 Answers 2


The thing was that Post.php file should be under

“app/code/Codextblog/Customemail/Controller/Index” directory, not in the “app/code/Codextblog/Customemail/Controller”.


Sending a Custom Email is very easy and can be done through a generated module.

Take a look at this example module which has a configuration option with a custom email template and a basic helper to send the email.


enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.