# Problem template mailer

**URL:** <https://discourse.cakephp.org/t/problem-template-mailer/7566>\
**Category:** Need Help\
**Created:** [March 31, 2020, 11:57pm UTC](https://discourse.cakephp.org/t/problem-template-mailer/7566 "2020-03-31T23:57:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![toutais75](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@toutais75](https://discourse.cakephp.org/u/toutais75)\
**Post date:** [March 31, 2020, 11:57pm UTC](https://discourse.cakephp.org/t/problem-template-mailer/7566/1 "2020-03-31T23:57:16Z")

</div>

hy!!!

I am trying to send an email with a template. but every time I try to include a template, the email crashes.  
Without the template, the email is sent and received.  
I use the viewBuilder and its setTemplate and setLayout object.  
I’m the doc but it still doesn’t work. I can’t understand or I’m wrong.

if someone could help me understand where my error is. Thanks for your help.

---

<div class="post-metadata">

**Author:** ![dreamingmind](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dreamingmind/32/1857_2.png) [@dreamingmind](https://discourse.cakephp.org/u/dreamingmind)\
**Post date:** [April 1, 2020, 12:38am UTC](https://discourse.cakephp.org/t/problem-template-mailer/7566/2 "2020-04-01T00:38:01Z")

</div>

I’m not knowledgeable about that system but I wonder if the DebugKit can help you. It may show error output?

[https://book.cakephp.org/debugkit/4/en/index.html#using-the-mail-panel](https://book.cakephp.org/debugkit/4/en/index.html#using-the-mail-panel)

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [April 1, 2020, 5:25am UTC](https://discourse.cakephp.org/t/problem-template-mailer/7566/3 "2020-04-01T05:25:50Z")

</div>

Or check your error log. There will be details somewhere. Have you tried it with a blank template (or just a bit of text, no PHP code)? If that works, then it’s a bug in your template code.
