Package org.mapfish.print.config
Class SmtpConfig
java.lang.Object
org.mapfish.print.config.SmtpConfig
- All Implemented Interfaces:
ConfigurationObject
Email sending configuration.
This configuration is needed only if reports are to be sent to the user by email.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBody()
Returns the configured body or the default value.getHost()
int
getPort()
boolean
isSsl()
boolean
void
The default email body.void
setErrorBody
(String errorBody) The default email body in case of error.void
setErrorSubject
(String errorSubject) The default email subject in case of error.void
setFromAddress
(String fromAddress) The email address used as "From:" in every email.void
The SMTP server hostname.void
setPassword
(String password) If auth is needed, the password.void
setPort
(int port) The TCP port of the SMTP server.void
setSsl
(boolean ssl) True for enabling SSL.void
setStarttls
(boolean starttls) True to use STARTTLS.void
setStorage
(ReportStorage storage) The report storage facility to use.void
setSubject
(String subject) The default email subject.void
setUsername
(String username) If auth is needed, the username.void
validate
(List<Throwable> validationErrors, Configuration configuration) validate that the configuration was correct.
-
Field Details
-
DEFAULT_SUBJECT
The default subject.- See Also:
-
DEFAULT_BODY
The default body.- See Also:
-
DEFAULT_BODY_STORAGE
The default body if there is a storage.- See Also:
-
DEFAULT_ERROR_SUBJECT
The default subject in case of error.- See Also:
-
DEFAULT_ERROR_BODY
The default body in case of error.- See Also:
-
-
Constructor Details
-
SmtpConfig
public SmtpConfig()
-
-
Method Details
-
validate
Description copied from interface:ConfigurationObject
validate that the configuration was correct.- Specified by:
validate
in interfaceConfigurationObject
- Parameters:
validationErrors
- a list to add any detected errors to.configuration
- the containing configuration
-
getFromAddress
-
setFromAddress
The email address used as "From:" in every email.- Parameters:
fromAddress
- The address
-
getHost
-
setHost
The SMTP server hostname.- Parameters:
host
- The host
-
getPort
public int getPort() -
setPort
public void setPort(int port) The TCP port of the SMTP server.- Parameters:
port
- The port
-
getUsername
-
setUsername
If auth is needed, the username.- Parameters:
username
- The username
-
getPassword
-
setPassword
If auth is needed, the password.- Parameters:
password
- The password
-
isStarttls
public boolean isStarttls() -
setStarttls
public void setStarttls(boolean starttls) True to use STARTTLS.- Parameters:
starttls
- Whatever
-
isSsl
public boolean isSsl() -
setSsl
public void setSsl(boolean ssl) True for enabling SSL.
Cannot be enabled at the same time asstarttls
- Parameters:
ssl
- The value
-
getSubject
-
setSubject
The default email subject.
This can be changed by thesmtp
.subject
property in the request.- Parameters:
subject
- The subject
-
getBody
Returns the configured body or the default value. -
setBody
The default email body.
This can be changed by thesmtp
.body
property in the request.If you have setup a storage, you must put a "{url}" marker where the URL to fetch the report should be put.
- Parameters:
body
- The body
-
getStorage
-
setStorage
The report storage facility to use.
By default, attaches the report in an email. But, for big files, this is not practical. This can be used to configure a storage.- Parameters:
storage
- The storage to use
-
getErrorSubject
-
setErrorSubject
The default email subject in case of error.
This can be changed by thesmtp
.errorSubject
property in the request.- Parameters:
errorSubject
- The subject
-
getErrorBody
-
setErrorBody
The default email body in case of error.
This can be changed by thesmtp
.body
property in the request.The error message can be places in the text using a "{message}" marker.
- Parameters:
errorBody
- The body
-