Package com.mendix.modules.email
Class EmailModule
java.lang.Object
com.mendix.modules.email.EmailModule
This class can be used to send email. All methods behave in a similar way, there are
just multiple methods for your convenience.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
mail
(ISMTPConfiguration configuration, String msg, String subject, String to) Sends an email to to with subject subject and message msg.static void
mail
(ISMTPConfiguration configuration, String msg, String subject, String to, IContext context, IMendixObject attachment) Sends an email to to with subject subject and message msg with attachment attachment using settings in configuration.static void
Sends an email to to with subject subject and message as html, the shown message will be htmlmsg.static void
mail
(ISMTPConfiguration configuration, String htmlmsg, String plainmsg, String subject, String to, IContext context, IMendixObject attachment) Sends an email to to with subject subject and HTML message htmlmsg with attachment attachment using settings in configuration.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) Sends an email to to, cc and bcc with subject subject and HTML message htmlmsg with attachments attachments using settings in configuration.static void
mail
(ISMTPConfiguration configuration, String msg, String subject, List<String> to, List<String> cc, List<String> bcc, IContext context, List<IMendixObject> attachments) Sends an email to to, cc and bcc with subject subject and message msg with attachments attachments using settings in configuration.
-
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 emailmsg
- the message to sendsubject
- the subject of the emailto
- 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 emailmsg
- the message to sendsubject
- the subject of the emailto
- the recipients of the email messagecc
- the CC recipientsbcc
- the BCC recipientscontext
- the context to use to check if the current user has the rights to access the attachmentsattachments
- 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 emailhtmlmsg
- the message body as html text this is what most of the recipients will seeplainmsg
- the message in plain text (this will be shown if the recipient doesn't accept html messages)subject
- the subject of the emailto
- the recipients of the email messagecc
- the CC recipientsbcc
- the BCC recipientscontext
- the context to use to check if the current user has the rights to access the attachmentsattachments
- 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 emailhtmlmsg
- the message body as html text this is what most of the recipients will seeplainmsg
- the message in plain text (this will be shown if the recipient doesn't accept html messages)subject
- the subject of the emailto
- 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 emailmsg
- the message body to sendsubject
- the subject of the emailto
- the recipients of the email messagecontext
- the context to use to check if the current user has the rights to access the attachmentsattachment
- 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 emailhtmlmsg
- the message body as html text this is what most of the recipients will seeplainmsg
- the message in plain text (this will be shown if the recipient doesn't accept html messages)subject
- the subject of the emailto
- the recipients of the email messagecontext
- the context to use to check if the current user has the rights to access the attachmentsattachment
- the attachment to send along with the email- Throws:
CoreException
- if sending the email message by mail failed
-