public interface MailSender
Modifier and Type | Method and Description |
---|---|
String |
getHost()
Gets the smpt host name.
|
String |
getPassword()
Gets the SMTP user password.
|
int |
getPort()
Gets the smtp port.
|
javax.mail.Session |
getSession()
Gets an smtp session with the currently configured properties, creating
a new session if the session has not been initialized.
|
String |
getUser()
Returns the smtp user name.
|
boolean |
isAuthenticated()
Gets authentication state of underlying mail session.
|
boolean |
isTls()
Whether or not TLS is used to connect to the SMTP server.
|
void |
send(org.springframework.mail.SimpleMailMessage message)
Sends a mail message using an smtp session with properties matching
the current bean property values.
|
void |
send(org.springframework.mail.SimpleMailMessage[] messages)
Sends an array of mail message using an smtp session with properties
matching the current bean property values.
|
void |
setAuthenticated(boolean authenticated)
Sets authentication state of underlying mail session.
|
void |
setHost(String host)
Sets the smtp host name.
|
void |
setPassword(String password)
Sets the password and forces reinitialization of the authenticated
mail session if the session is authenticated.
|
void |
setPort(int port)
Sets the smpt port.
|
void |
setSession(javax.mail.Session session)
Sets the smtp session and modifies bean properties to match those of
the given session.
|
void |
setTls(boolean tls)
Gets TLS state of underlying mail session.
|
void |
setUser(String user)
Sets the smpt user name and forces reinitialization of the authenticated
mail session if the session is authenticated.
|
String getPassword()
void setPassword(String password)
password
- new value for the passwordString getUser()
void setUser(String user)
user
- new value for the user namejavax.mail.Session getSession()
void setSession(javax.mail.Session session)
session
- the new sessionString getHost()
localhost
.void setHost(String host)
host
- the new smtp host nameint getPort()
25
.void setPort(int port)
port
- the new smtp portboolean isAuthenticated()
false
.void setAuthenticated(boolean authenticated)
authenticated
- new value for session authentication propertyboolean isTls()
false
.void setTls(boolean tls)
tls
- new value for TLS transport propertyvoid send(org.springframework.mail.SimpleMailMessage message) throws org.springframework.mail.MailException
message
- message to sendorg.springframework.mail.MailException
- if a messsaging exception occurs sending
the messagevoid send(org.springframework.mail.SimpleMailMessage[] messages) throws org.springframework.mail.MailException
messages
- messages to sendorg.springframework.mail.MailException
- if a messsaging exception occursCopyright © 2003-2017 The Virtual Library Team. All Rights Reserved.