<?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>Mail Service in docker not success</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121333468" />
  <subtitle>Mail Service in docker not success</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121333468</id>
  <updated>2026-04-06T22:11:43Z</updated>
  <dc:date>2026-04-06T22:11:43Z</dc:date>
  <entry>
    <title>Mail Service in docker not success</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121333467" />
    <author>
      <name>SHAHRUL AZHAR</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121333467</id>
    <updated>2022-01-19T13:36:48Z</updated>
    <published>2022-01-19T00:38:56Z</published>
    <summary type="html">&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;I'm using liferay 7.4&lt;/p&gt;
&lt;p&gt;I set the mail configuration at control panel&amp;gt;Server Administration&amp;gt;mail&lt;/p&gt;
&lt;p&gt;then, in portlet, i just call mail service provided by liferay&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;private void sendMailMessage(
            ActionRequest actionRequest, ActionResponse actionResponse, String mailFrom, String mailTo, String title, String body)
				throws IOException, PortletException {
				String mailSubject=title;
				String mailBody=body;
				String senderMailAddress=mailFrom;
				String receiverMailAddress=mailTo;
				try {
				            MailMessage mailMessage=new MailMessage();
				            mailMessage.setBody(mailBody);
				            mailMessage.setSubject(mailSubject);
				            mailMessage.setFrom(new InternetAddress(senderMailAddress));
				            mailMessage.setTo(new InternetAddress(receiverMailAddress));
				            MailServiceUtil.sendEmail(mailMessage);
				    // SessionMessages.add((HttpServletRequest) actionRequest.getPortletSession(),&amp;quot;mail-send-success&amp;quot;);
				}
				catch (Exception e) {
				    e.printStackTrace();
				}
	}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;In my local pc, it working fine...it can send the mail successfully.&lt;/p&gt;
&lt;p&gt;When i deploy the portlet to my development server in ubuntu (this
  liferay setup using docker), it not send the mail. Eventhough, it also
  not even have any error message inside log. How to configure that mail
  inside docker?&lt;/p&gt;</summary>
    <dc:creator>SHAHRUL AZHAR</dc:creator>
    <dc:date>2022-01-19T00:38:56Z</dc:date>
  </entry>
</feed>
