Package de.xima.fc.mail.interfaces
Interface IMailContext
- All Known Implementing Classes:
DefaultMailContext
,MSGraphMailContext
,PasswordMailContext
public interface IMailContext
A mail context that can send emails. Implementations may employ different methods of sending the mail, such as via an
SMTP server or via a REST API.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
archive
(IBaseMailData mail, Mandant client, File file) Create an archived file of the mail.Gets the mail server data of the contextdefault void
send
(IBaseMailData mail) Sends an mail based on the given datadefault void
send
(IBaseMailData mail, Mandant client) Sends a mail based on the given datasendWithReport
(IBaseMailData mail) Sends a mail based on the given datasendWithReport
(IBaseMailData mail, Mandant client) Sends a mail based on the given datadefault void
setAddressFilter
(de.xima.cmn.filter.IGenericFilter<javax.mail.Address> addressFilter) Deprecated.void
setAddressFilter
(Predicate<javax.mail.Address> addressFilter) Sets an filter for excluding mail addresses during send
-
Method Details
-
archive
Create an archived file of the mail.- Parameters:
mail
- Data of the email to send.client
- The client to use for placeholder replacements.file
- The file to write to.- Throws:
Exception
- When the archive file could not be created.
-
getServerData
IMailServerData getServerData()Gets the mail server data of the context- Returns:
- the server data
-
send
Sends an mail based on the given data- Parameters:
mail
- Data with the mail or mails to sent.- Throws:
Exception
- When the mail could not be sent, e.g. due to network errors or invalid mail addresses.
-
send
Sends a mail based on the given data- Parameters:
mail
- Data with the mail or mails to sent.client
- The client scope to use for placeholder replacements- Throws:
Exception
- When the mail could not be sent, e.g. due to network errors or invalid mail addresses.
-
sendWithReport
Sends a mail based on the given data- Parameters:
mail
- Data with the mail or mails to sent.- Returns:
- Information about the mails that were actually sent.
- Throws:
Exception
- When the mail could not be sent, e.g. due to network errors or invalid mail addresses.
-
sendWithReport
Sends a mail based on the given data- Parameters:
mail
- Data with the mail or mails to sent.client
- The client scope to use for placeholder replacements- Returns:
- Information about the mails that were actually sent.
- Throws:
Exception
- When the mail could not be sent, e.g. due to network errors or invalid mail addresses.
-
setAddressFilter
@Deprecated default void setAddressFilter(de.xima.cmn.filter.IGenericFilter<javax.mail.Address> addressFilter) Deprecated.Sets an filter for excluding mail addresses during send- Parameters:
addressFilter
- the address filter to set
-
setAddressFilter
Sets an filter for excluding mail addresses during send- Parameters:
addressFilter
- the address filter to set- Since:
- 8.0.0
-
setAddressFilter(Predicate)
.