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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
fetch()
Fetch mails from remote mail server.List<javax.mail.internet.InternetAddress>
findEmails(String matching, List<String> selected, int maxResults)
Search for email addresses matching the given text.Model
resolve(String email)
Resolve the given email address to an associated entity.void
send(MailMessage message)
Send a mail for the givenMailMessage
.
-
-
-
Method Detail
-
send
void send(MailMessage message) throws MailException
Send a mail for the givenMailMessage
.- Parameters:
message
- the message to send- Throws:
MailException
- on failure
-
fetch
void fetch() throws MailException
Fetch mails from remote mail server.- Throws:
MailException
- on failure
-
resolve
Model resolve(String email)
Resolve the given email address to an associated entity.Generally, it should resolve to the
User
,Contact
,Partner
orCustomer
that represents a contact.The default implementation resolves to the
User
records.- Parameters:
email
- the email address to resolve- Returns:
- associated entity or null if can't be resolved
-
findEmails
List<javax.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
-
-