Package org.nuclos.api.provider
Class MailProvider
java.lang.Object
org.nuclos.api.provider.MailProvider
This class is used in rule programming and provides methods for sending and receiving
E-mails.
Please check Nuclos system parameter for setting connection parameter like POP3/SMTP
- Author:
- Matthias Reichart
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<NuclosMail>
receive
(boolean bDeleteMails) This method retrieves allNuclosMail
s that can be found in the Inbox of the account mentioned in the system parameters.static List<NuclosMail>
This method retrieves allNuclosMail
s that can be found in the specified folder of the account mentioned in the system parameters.static void
send
(InputStream is) Takes an email as an .eml from an input stream and sends it.static void
send
(NuclosMail mail) This method sends aNuclosMail
All connection settings like POP3/SMTP must be set in Nuclos as system parametersvoid
setMailService
(MailService repService) static void
transformToEml
(NuclosMail nuclosMail, OutputStream outputStream) Transforms aNuclosMail
to the EML format and writes it to the specifiedOutputStream
.
-
Constructor Details
-
MailProvider
public MailProvider()
-
-
Method Details
-
setMailService
-
send
This method sends aNuclosMail
All connection settings like POP3/SMTP must be set in Nuclos as system parameters- Parameters:
mail
-NuclosMail
- email to send- Throws:
BusinessException
-
send
Takes an email as an .eml from an input stream and sends it.- Parameters:
is
- - input stream, which holds the email as a .eml- Throws:
BusinessException
- - problem, which occurred while attempting to send
-
receive
This method retrieves allNuclosMail
s that can be found in the Inbox of the account mentioned in the system parameters.If argument 'bDeleteMails' is true, all mails will be deleted after retrieving them from the server.
All connection settings like POP3/SMTP must be set in Nuclos as system parameters
- Parameters:
bDeleteMails
- - bDeleteMails- Returns:
- List of
NuclosFile
- Throws:
BusinessException
-
receive
public static List<NuclosMail> receive(String folderFrom, boolean bDeleteMails) throws BusinessException This method retrieves allNuclosMail
s that can be found in the specified folder of the account mentioned in the system parameters.Fetching mails from specific folders only works via IMAP. For POP3 the folder is always "INBOX".
If argument 'bDeleteMails' is true, all mails will be deleted after retrieving them from the server.
All connection settings like POP3/SMTP must be set in Nuclos as system parameters
- Parameters:
folderFrom
-bDeleteMails
- - bDeleteMails- Returns:
- List of
NuclosFile
- Throws:
BusinessException
-
transformToEml
public static void transformToEml(NuclosMail nuclosMail, OutputStream outputStream) throws BusinessException Transforms aNuclosMail
to the EML format and writes it to the specifiedOutputStream
.- Parameters:
nuclosMail
- -NuclosMail
, that should be transformedoutputStream
- -OutputStream
, where the EML is written to- Throws:
BusinessException
-