Class MailProvider
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 List<NuclosMail>
This method retrieves allNuclosMail
s that can be found in the folder specified in a specific incoming email server configuration.static List<NuclosMail>
This method retrieves allNuclosMail
s that can be found in the specified folder in a specific incoming email server configuration.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 parametersstatic void
send
(UID outgoingServer, InputStream is) Takes an email as an .eml from an input stream and sends it via a specific outgoing server.static void
send
(UID outgoingServer, NuclosMail mail) This method sends aNuclosMail
via a specific outgoing servervoid
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
This method sends aNuclosMail
via a specific outgoing server- Parameters:
outgoingServer
-UID
- UID of outgoing email servermail
-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
-
send
Takes an email as an .eml from an input stream and sends it via a specific outgoing server.- Parameters:
outgoingServer
-UID
- UID of outgoing email serveris
- - 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(UID incomingEmailServer, boolean bDeleteMails) throws BusinessException This method retrieves allNuclosMail
s that can be found in the folder specified in a specific incoming email server configuration.If argument 'bDeleteMails' is true, all mails will be deleted after retrieving them from the server.
- Parameters:
incomingEmailServer
-UID
- UID of incoming email serverbDeleteMails
- - 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
-
receive
public static List<NuclosMail> receive(UID incomingEmailServer, String folderFrom, boolean bDeleteMails) throws BusinessException This method retrieves allNuclosMail
s that can be found in the specified folder in a specific incoming email server configuration.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:
incomingEmailServer
-UID
- UID of incoming email serverfolderFrom
- - directory to fetch emails frombDeleteMails
- - 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
-