Package com.axelor.mail.service
Interface MailService
- All Known Implementing Classes:
MailServiceImpl
public interface MailService
The mail service defines interface for sending/reading mails.
-
Method Summary
Modifier and TypeMethodDescriptionvoidfetch()Fetch mails from remote mail server.List<jakarta.mail.internet.InternetAddress> findEmails(String matching, List<String> selected, int maxResults) Search for email addresses matching the given text.Resolve the given email address to an associated entity.voidsend(MailMessage message) Send a mail for the givenMailMessage.
-
Method Details
-
send
Send a mail for the givenMailMessage.- Parameters:
message- the message to send- Throws:
MailException- on failure
-
fetch
Fetch mails from remote mail server.- Throws:
MailException- on failure
-
resolve
Resolve the given email address to an associated entity.Generally, it should resolve to the
User,Contact,PartnerorCustomerthat represents a contact.The default implementation resolves to the
Userrecords.- Parameters:
email- the email address to resolve- Returns:
- associated entity or null if can't be resolved
-
findEmails
List<jakarta.mail.internet.InternetAddress> findEmails(String matching, List<String> selected, int maxResults) Search for email addresses matching the given text.- Parameters:
matching- the match textselected- already selected email addressesmaxResults- maximum number of items to return- Returns:
- list of
InternetAddress
-