How to configure the Mail Binding to use GMail for sending email from openHAB

I add two more things, as they are probably errors that may occur more often. In the Karaf Console, the following error may occur:

My log is getting permanent spammed with failure : [ERROR] [xbase.resource.BatchLinkableResource] - resolution of uriFragment ‘|::0.2.0.2.0.3.6.1.7::0::/1’ failed

The solution to this can be found here:

[SOLVED] I having trouble new mail binding

I have solved this as follows for me:

val mailActions = getActions("mail","mail:smtp:<YOUR_THING_ID>")

rule "<YOUR_RULE_NAME>"
when
    <YOUR_TRIGGER>
then
    ...
    var receiver="<MAIL_TO@YOUR_RECEIVER>"
    var title="<YOUR_TITLE>"
    var text="<YOUR_TEXT>"
    mailActions.sendMail(receiver, title, text)
    ...
end