I have created a custom module in Magento 2 for sending the mail but it doesn't send ant mail in my mailbox.

There will be no error shown on page itself please any one help about that. Any help is appreciated.

  • Add files of module to provide better understanding in question. Commented Sep 5, 2020 at 5:40
  • Updated my code please check @HamendraSunthwal
    – Prits
    Commented Sep 5, 2020 at 5:46
  • have you checked logs ? Commented Sep 5, 2020 at 5:59
  • Just checked Controller Post.php which is form action goes to 302 status code in network. That's why it doesn't send mail i think @HamendraSunthwal
    – Prits
    Commented Sep 5, 2020 at 6:13
  • 1
    check this link :- rakeshjesadiya.com/send-mail-from-custom-module-magento-2 Commented Sep 5, 2020 at 11:38

1 Answer 1


Check this link i hope your issue is solve. check below link


Any query let me know


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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