Mail Service in docker not successMail Service in docker not successhttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1213334682024-03-28T12:03:24Z2024-03-28T12:03:24ZMail Service in docker not successSHAHRUL AZHARhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1213334672022-01-19T13:36:48Z2022-01-19T00:38:56Z<p>Hi, </p>
<p>I'm using liferay 7.4</p>
<p>I set the mail configuration at control panel>Server Administration>mail</p>
<p>then, in portlet, i just call mail service provided by liferay</p>
<pre>
<code class="language-java">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(),"mail-send-success");
}
catch (Exception e) {
e.printStackTrace();
}
}</code></pre>
<p> </p>
<p>In my local pc, it working fine...it can send the mail successfully.</p>
<p>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?