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
RE: Mail service not success inside docker
Hello, I'm using liferay 7.4
I configure mail property through control panel > system administration > mail
In my local pc in window, i successfully receive mail. But when I put my portlet to server ubuntu (install liferay using docker), I not successfully receive the mail. Eventhouh error message also not produce inside log
My code in portlet is in below
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();
}
}
What should I do now so that I can receive mail service successfully. Thanks
What's in the logs? Mail is configured on server level - e.g. the account used to send. Both sender as well as the credentials with some email provider. If you have configured this on your local machine, but not on another server, it won't work where it's unconfigured.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™