Emailing using Mail Composer

Written by Anthony Pavia on Oct 20, 2022 2:02 pm

After configuring the JNIOR properly, a way to send an email from it is to use the MailComposer class. This function has the user define the email being sent by building different parts of the email (Email address being sent to, Attachments to add, anyone that needs CC’d, subject, message, etc). Once these are all defined, you can use the MailComposer’s send() function to submit the email.

package emailexample;

import com.integpg.system.JANOS;
import com.integpg.system.MailComposer;

public class EmailExample {

    public static MailComposer mail = new MailComposer();
    
    public static void main(String[] args) {
        
        mail.setToAddress("YOUR EMAIL HERE");
        mail.setSubject("MailComposer Test");
        mail.setMessage("This was built and sent using the MailComposer Class.");
        mail.send();
        
    }
    
}

I put the built jar file of this example application into the JNIOR’s flash folder and ran it from the Web UI’s console tab. After it had successfully run, I checked my email and received one from the MailComposer example.

On this page
Tags