public class MailSenderImpl extends Object implements MailSender
MailSender implementation.
The mail session is lazy initialized and reinitialized when properties
are changed.| Constructor and Description |
|---|
MailSenderImpl() |
| 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.
|
public boolean isTls()
MailSenderfalse.isTls in interface MailSenderpublic void setTls(boolean tls)
MailSendersetTls in interface MailSendertls - new value for TLS transport propertypublic boolean isAuthenticated()
MailSenderfalse.isAuthenticated in interface MailSenderpublic void setAuthenticated(boolean authenticated)
MailSendersetAuthenticated in interface MailSenderauthenticated - new value for session authentication propertypublic String getPassword()
MailSendergetPassword in interface MailSenderpublic void setPassword(String password)
MailSendersetPassword in interface MailSenderpassword - new value for the passwordpublic String getUser()
MailSendergetUser in interface MailSenderpublic void setUser(String user)
MailSendersetUser in interface MailSenderuser - new value for the user namepublic javax.mail.Session getSession()
MailSendergetSession in interface MailSenderpublic void setSession(javax.mail.Session session)
MailSendersetSession in interface MailSendersession - the new sessionpublic String getHost()
MailSenderlocalhost.getHost in interface MailSenderpublic void setHost(String host)
MailSendersetHost in interface MailSenderhost - the new smtp host namepublic int getPort()
MailSender25.getPort in interface MailSenderpublic void setPort(int port)
MailSendersetPort in interface MailSenderport - the new smtp portpublic void send(org.springframework.mail.SimpleMailMessage message)
throws org.springframework.mail.MailException
MailSendersend in interface MailSendermessage - message to sendorg.springframework.mail.MailException - if a messsaging exception occurs sending
the messagepublic void send(org.springframework.mail.SimpleMailMessage[] messages)
throws org.springframework.mail.MailException
MailSendersend in interface MailSendermessages - messages to sendorg.springframework.mail.MailException - if a messsaging exception occursCopyright © 2003-2017 The Virtual Library Team. All Rights Reserved.