Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Mail Service in docker not success
Hi,
I'm using liferay 7.4
I set the mail configuration at control panel>Server Administration>mail
then, in portlet, i just call mail service provided by liferay
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();
}
}
In my local pc, it working fine...it can send the mail successfully.
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?
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™