Enabling email notification for Model building completion in WSO2 ML

Enable mail transport sender in axis2-client.xml

Open <ML_HOME>/repository/conf/axis2/axis2_client.xml and add the following.

<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
        <parameter name="mail.smtp.from">gmailId@gmail.com</parameter>
        <parameter name="mail.smtp.user">gmailId</parameter>
        <parameter name="mail.smtp.password">password</parameter>
        <parameter name="mail.smtp.host">smtp.gmail.com</parameter>
        <parameter name="mail.smtp.port">587</parameter>
        <parameter name="mail.smtp.starttls.enable">true</parameter>
        <parameter name="mail.smtp.auth">true</parameter>

Here gmailId is the id of the gmail account (eg. mail.smtp.from=supuns@wso2.com and mail.smtp.use=supuns), and password is the password for the gmail account defined above.

Enable security for Sender email

Sometimes gmail block third-party applications (in this case, axis2) from using the gmail account for security reasons. Hence it may be required to enable “less secure apps” in your sender-email account. For that go to the link: https://www.google.com/settings/security/lesssecureapps and trun on the access for less secure apps.

Set the receiver email in the machine-learner.xml

Open <ML_HOME>/repository/conf/machine-learner.xml and set the receiver email to the following property.


All the notification related to model building completion (success/failure) will be sent to the email address defined here.

Email templates for each notification type can be found at <ML_HOME>/repository/conf/email/ml-email-templates.xml