@Service
public class MailService
extends java.lang.Object
| Constructor and Description |
|---|
MailService(java.lang.String host,
int port) |
| Modifier and Type | Method and Description |
|---|---|
void |
sendMail(Mail mail)
Sends out the given email
|
public MailService(@Value(value="${SmtpServer}")
java.lang.String host,
@Value(value="${SmtpPort}")
int port)
host - The address of the server.port - The port of the server, usually 25.java.lang.IllegalArgumentException - Thrown when given a timeout of zero or less.public void sendMail(Mail mail) throws MailException
mail - Mail to sendMailException - if the email can't be sent due to unavailability of a mail server or invalid
attributes in the Mail object, such as sender address, destination addresses, cc, bcc addresses etc.