Class EmailModule

java.lang.Object
com.mendix.modules.email.EmailModule

public class EmailModule extends Object
This class can be used to send email. All methods behave in a similar way, there are just multiple methods for your convenience.
  • Constructor Details

    • EmailModule

      public EmailModule()
  • Method Details

    • mail

      public static void mail(ISMTPConfiguration configuration, String msg, String subject, String to) throws CoreException
      Sends an email to to with subject subject and message msg.
      Parameters:
      configuration - the SMTP configuration that contains all information to send the email
      msg - the message to send
      subject - the subject of the email
      to - the recipients of the email message
      Throws:
      CoreException - if sending the email message by mail failed
    • mail

      public static void mail(ISMTPConfiguration configuration, String msg, String subject, List<String> to, List<String> cc, List<String> bcc, IContext context, List<IMendixObject> attachments) throws CoreException
      Sends an email to to, cc and bcc with subject subject and message msg with attachments attachments using settings in configuration.
      Parameters:
      configuration - the SMTP configuration that contains all information to send the email
      msg - the message to send
      subject - the subject of the email
      to - the recipients of the email message
      cc - the CC recipients
      bcc - the BCC recipients
      context - the context to use to check if the current user has the rights to access the attachments
      attachments - the attachments to send along with the email
      Throws:
      CoreException - if sending the email message by mail failed
    • mail

      public static void mail(ISMTPConfiguration configuration, String htmlmsg, String plainmsg, String subject, List<String> to, List<String> cc, List<String> bcc, IContext context, List<IMendixObject> attachments) throws CoreException
      Sends an email to to, cc and bcc with subject subject and HTML message htmlmsg with attachments attachments using settings in configuration.
      Parameters:
      configuration - the SMTP configuration that contains all information to send the email
      htmlmsg - the message body as html text this is what most of the recipients will see
      plainmsg - the message in plain text (this will be shown if the recipient doesn't accept html messages)
      subject - the subject of the email
      to - the recipients of the email message
      cc - the CC recipients
      bcc - the BCC recipients
      context - the context to use to check if the current user has the rights to access the attachments
      attachments - the attachments to send along with the email
      Throws:
      CoreException - if sending the email message by mail failed
    • mail

      public static void mail(ISMTPConfiguration configuration, String htmlmsg, String plainmsg, String subject, String to) throws CoreException
      Sends an email to to with subject subject and message as html, the shown message will be htmlmsg. If the receipts don't support html messages the plainmsg will be shown.
      Parameters:
      configuration - the SMTP configuration that contains all information to send the email
      htmlmsg - the message body as html text this is what most of the recipients will see
      plainmsg - the message in plain text (this will be shown if the recipient doesn't accept html messages)
      subject - the subject of the email
      to - the recipients of the email message
      Throws:
      CoreException - if sending the email message by mail failed
    • mail

      public static void mail(ISMTPConfiguration configuration, String msg, String subject, String to, IContext context, IMendixObject attachment) throws CoreException
      Sends an email to to with subject subject and message msg with attachment attachment using settings in configuration.
      Parameters:
      configuration - the SMTP configuration that contains all information to send the email
      msg - the message body to send
      subject - the subject of the email
      to - the recipients of the email message
      context - the context to use to check if the current user has the rights to access the attachments
      attachment - the attachment to send along with the email
      Throws:
      CoreException - if sending the email message by mail failed
    • mail

      public static void mail(ISMTPConfiguration configuration, String htmlmsg, String plainmsg, String subject, String to, IContext context, IMendixObject attachment) throws CoreException
      Sends an email to to with subject subject and HTML message htmlmsg with attachment attachment using settings in configuration.
      Parameters:
      configuration - the SMTP configuration that contains all information to send the email
      htmlmsg - the message body as html text this is what most of the recipients will see
      plainmsg - the message in plain text (this will be shown if the recipient doesn't accept html messages)
      subject - the subject of the email
      to - the recipients of the email message
      context - the context to use to check if the current user has the rights to access the attachments
      attachment - the attachment to send along with the email
      Throws:
      CoreException - if sending the email message by mail failed