Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between MailServiceUtil.sendEmail() and MailEngine.send()

Which of these methods is recommended?

Is any one of these methods outdated?

Do both use internally auth properties set in the portal?

I read the source for both methods, and while MailEngine is a high level abstraction of typical transport, send functionality, etc; MailLocalService uses beanLocator for an external Service.

Which one is that?

like image 680
Whimusical Avatar asked Jun 21 '26 18:06

Whimusical


1 Answers

MailEngine is in util-java.jar, in Liferay's WEB-INF/lib, so you can't access it from your plugins (other than ext-plugin). For this reason consider it an implementation detail with no guaranteed or implied stability.

MailServiceUtil is the API service front-end class. This is part of the API and you can reasonably expect it to be quite stable. And you can use it from your plugins as well.

like image 50
Olaf Kock Avatar answered Jun 25 '26 02:06

Olaf Kock



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!