<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>How to debug emails in LF7?</title>
  <link rel="self" href="https://liferay.dev/de/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=112721929" />
  <subtitle>How to debug emails in LF7?</subtitle>
  <id>https://liferay.dev/de/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=112721929</id>
  <updated>2026-06-12T21:33:59Z</updated>
  <dc:date>2026-06-12T21:33:59Z</dc:date>
  <entry>
    <title>RE: How to debug emails in LF7?</title>
    <link rel="alternate" href="https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118769792" />
    <author>
      <name>Scott McIntosh</name>
    </author>
    <id>https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118769792</id>
    <updated>2020-03-19T16:59:23Z</updated>
    <published>2020-03-19T16:59:23Z</published>
    <summary type="html">I know this is an old thread, but in case anyone comes looking I wanted to say that I had no problem setting com.liferay.petra.mail.MailEngine to DEBUG via the Server Administration.</summary>
    <dc:creator>Scott McIntosh</dc:creator>
    <dc:date>2020-03-19T16:59:23Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to debug emails in LF7?</title>
    <link rel="alternate" href="https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112774251" />
    <author>
      <name>Jan Tošovský</name>
    </author>
    <id>https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112774251</id>
    <updated>2019-03-15T08:50:18Z</updated>
    <published>2019-03-15T08:50:18Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;So emails are sent using petra-mail module: &lt;a href="https://github.com/liferay/liferay-portal/blob/master/modules/apps/petra/petra-mail/src/main/java/com/liferay/petra/mail/MailEngine.java"&gt;https://github.com/liferay/liferay-portal/blob/master/modules/apps/petra/petra-mail/src/main/java/com/liferay/petra/mail/MailEngine.java&lt;br&gt;&lt;/a&gt;&lt;br&gt;The logging is still available, but it cannot be activated directly from the Server Administration as it is not a core LR functionality any more. So the only way to enable debugging is to tweak log4j properties:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;logger name="com.liferay.petra.mail"&amp;gt;
   &amp;lt;level value="DEBUG" /&amp;gt;
&amp;lt;/logger&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;Tested, it works.&lt;br&gt;&lt;br&gt;Btw, for testing you can generate emails via script. Go to the Script tab in the Server Administration and paste this Gist:&lt;br&gt;&lt;a href="https://gist.github.com/jan-tosovsky-cz/56cd44d3216fb056d9b4259a997a9e86"&gt;https://gist.github.com/jan-tosovsky-cz/56cd44d3216fb056d9b4259a997a9e86&lt;/a&gt;&amp;nbsp; &lt;br&gt;&lt;br&gt;Jan&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Jan Tošovský</dc:creator>
    <dc:date>2019-03-15T08:50:18Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to debug emails in LF7?</title>
    <link rel="alternate" href="https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112729575" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112729575</id>
    <updated>2019-03-13T16:50:39Z</updated>
    <published>2019-03-13T16:50:39Z</published>
    <summary type="html">&lt;blockquote&gt;Jan Tošovský&lt;br /&gt;&lt;br /&gt;After printing  &amp;#34;sendEmail&amp;#34; message the task is forwarded to the MessageBus, where I am loosing the track what is done next.&lt;br /&gt;&lt;/blockquote&gt;&lt;a href="https://github.com/liferay/liferay-portal/blob/0a5bb514913ee7e6f765926451900f8c7967fc48/portal-impl/src/com/liferay/mail/messaging/MailMessageListener.java"&gt;This&lt;/a&gt; might be the actual sender</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2019-03-13T16:50:39Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to debug emails in LF7?</title>
    <link rel="alternate" href="https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112724649" />
    <author>
      <name>Jan Tošovský</name>
    </author>
    <id>https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112724649</id>
    <updated>2019-03-13T14:53:01Z</updated>
    <published>2019-03-13T14:53:01Z</published>
    <summary type="html">Seeing the code responsible for sending emails I am afraid that log level settings won&amp;#39;t help here anymore:&lt;br /&gt;&lt;br /&gt;&lt;a href="https://github.com/liferay/liferay-portal/blob/0a5bb514913ee7e6f765926451900f8c7967fc48/portal-impl/src/com/liferay/mail/service/impl/MailServiceImpl.java#L260"&gt;https://github.com/liferay/liferay-portal/blob/0a5bb514913ee7e6f765926451900f8c7967fc48/portal-impl/src/com/liferay/mail/service/impl/MailServiceImpl.java#L260&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After printing  &amp;#34;sendEmail&amp;#34; message the task is forwarded to the MessageBus, where I am loosing the track what is done next.</summary>
    <dc:creator>Jan Tošovský</dc:creator>
    <dc:date>2019-03-13T14:53:01Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to debug emails in LF7?</title>
    <link rel="alternate" href="https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112722918" />
    <author>
      <name>Fernando Fernandez</name>
    </author>
    <id>https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112722918</id>
    <updated>2019-03-13T12:48:18Z</updated>
    <published>2019-03-13T12:48:18Z</published>
    <summary type="html">Hi Václav,&lt;br /&gt;&lt;br /&gt;As a complement to debugging the emails inside the Liferay stack, I find a tool like &lt;a href="http://nilhcem.com/FakeSMTP/"&gt;FakeSMTP&lt;/a&gt; very useful. It&amp;#39;s a fake server you can use on your dev machine and &amp;#34;trap&amp;#34; outgoing emails, allowing you to immediatly look at headers and message bodies.&lt;br /&gt;&lt;br /&gt;HTH&lt;br /&gt;&lt;br /&gt;Fernando</summary>
    <dc:creator>Fernando Fernandez</dc:creator>
    <dc:date>2019-03-13T12:48:18Z</dc:date>
  </entry>
  <entry>
    <title>How to debug emails in LF7?</title>
    <link rel="alternate" href="https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112721928" />
    <author>
      <name>Václav Suchánek</name>
    </author>
    <id>https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112721928</id>
    <updated>2019-03-13T12:33:52Z</updated>
    <published>2019-03-13T12:33:52Z</published>
    <summary type="html">Hello,&lt;br /&gt;&lt;br /&gt;Is there an easy way how to trace/debug outcoming emails?&lt;br /&gt;&lt;br /&gt;My scenario:&lt;br /&gt;I am implementing in ServiceConfiguration.java custom email templates (custom.tmpl) for actions - article added and update.&lt;br /&gt;My feature is ready to go, but i don&amp;#39;t know how to debug these customized emails.&lt;br /&gt;&lt;br /&gt;I have tried these methods:&lt;br /&gt;&lt;br /&gt;1) To create 2 testing accounts (allowing them email notification in Account settings -&amp;gt; Alerts and Annoucements delivery)&lt;br /&gt;     Results was: Only notifications were sent but no emails. Tested on default MessageBoards portlet and Wiki portlet.&lt;br /&gt;&lt;br /&gt;2) Follow this blog: &lt;a href="https://community.liferay.com/blogs/-/blogs/how-to-trace-mail-in-liferay-portal"&gt;https://community.liferay.com/blogs/-/blogs/how-to-trace-mail-in-liferay-portal&lt;br /&gt;&lt;/a&gt;    To set debug level in Server administration or in portal-log4j-ext.xml on email related categories.&lt;br /&gt;    To set debug level in Server Administration -&amp;gt; Log Levels -&amp;gt; set debug level on com.liferay.mail.service.impl.MailServiceImpl and on all mail category related items.&lt;br /&gt;    Result was: Only one line in tomcat console showed up:&lt;br /&gt;    2019-03-13 10:34:16.033 DEBUG [liferay/subscription_sender-1][MailServiceImpl:257] sendEmail&lt;br /&gt;    This line is nice, but i would like to know the email body.&lt;br /&gt;&lt;br /&gt;Is there an another way or recomendation how to do it? Maybe use some extension/overrides for debugging MailServiceImpl methods? Or somehow work with an optional JavaMail properties in mail server administration?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;My env:&lt;br /&gt;&lt;br /&gt;liferay ce portal 7.1.2 ga3&lt;br /&gt;tomcat 9.0.10&lt;br /&gt;tested on localhost&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks in advance.&lt;br /&gt;&lt;br /&gt;Vaclav</summary>
    <dc:creator>Václav Suchánek</dc:creator>
    <dc:date>2019-03-13T12:33:52Z</dc:date>
  </entry>
</feed>
