public interface EmailService extends BaseService
EmailService
can be used to send an email with a file
attachment. Each instance of EmailService
is initialized with
the PAS Server default SMTP values stored in the settings. Changing the SMTP
values for an instance of EmailService
does not affect the PAS
Server settings. The following values are initialized from the PAS Server
settings:
Modifier and Type | Interface and Description |
---|---|
static interface |
EmailService.Email
This class contains the fields specific to an email message.
|
Modifier and Type | Method and Description |
---|---|
EmailService.Email |
createNewEmail()
Creates a new instance of
Email . |
String |
getPOP3Server()
Returns the POP3 server for this SMTP server, or
null if a
POP3 connection is not used. |
String |
getSMTPFromName()
Returns the SMTP from name for this
EmailService . |
String |
getSMTPPassword()
Returns the SMTP password for this
EmailService . |
String |
getSMTPServer()
Returns the current SMTP server for this
EmailService . |
String |
getSMTPUserName()
Returns the SMTP user name for this
EmailService . |
boolean |
isPOP3SSL()
Returns whether or not the POP3 server for this
EmailService
will use the SSL protocol. |
boolean |
isSMTPSSL()
Returns whether or not this
EmailService will use the
TLS/SSL protocol for this SMTP server. |
void |
sendEmail(EmailService.Email email)
This method sends an email using the current SMTP settings in the
EmailService and the parameters specified in the
Email . |
void |
setPOP3Server(String pop3Server)
Sets the POP3 server for this SMTP server.
|
void |
setPOP3SSL(boolean enabled)
Enables the SSL protocol for the POP3 server for this
EmailService . |
void |
setSMTPFromName(String smtpFromName)
Sets the SMTP from name for this
EmailService . |
void |
setSMTPPassword(String smtpPassword)
Sets the SMTP password for this
EmailService . |
void |
setSMTPServer(String smtpServer)
Sets the SMTP server for this
EmailService . |
void |
setSMTPSSL(boolean enabled)
Enables the TLS/SSL protocol for this
EmailService . |
void |
setSMTPUserName(String smtpUuserName)
Sets the SMTP user name for this
EmailService . |
EmailService.Email createNewEmail()
Email
. Once the email parameters
are specified, the Email
can be sent using
sendEmail(com.qoppa.pas.api.service.EmailService.Email)
.Email
sendEmail(Email)
void sendEmail(EmailService.Email email)
EmailService
and the parameters specified in the
Email
.email
- the Email
to sendcreateNewEmail()
String getSMTPServer()
EmailService
.EmailService
void setSMTPServer(String smtpServer)
EmailService
.smtpServer
- the SMTP server for this EmailService
.boolean isSMTPSSL()
EmailService
will use the
TLS/SSL protocol for this SMTP server.EmailService
will use the TLS/SSL
protocol, false otherwisevoid setSMTPSSL(boolean enabled)
EmailService
. If
enabled, the EmailService
will use the TLS/SSL protocol when
sending email.enabled
- true if the TLS/SSL protocol is enabled, false otherwiseString getSMTPUserName()
EmailService
.EmailService
void setSMTPUserName(String smtpUuserName)
EmailService
.smtpUuserName
- the SMTP user name to setString getSMTPPassword()
EmailService
.EmailService
void setSMTPPassword(String smtpPassword)
EmailService
.smtpPassword
- the SMTP password to setString getSMTPFromName()
EmailService
.EmailService
void setSMTPFromName(String smtpFromName)
EmailService
.smtpFromName
- the SMTP from name to setvoid setPOP3Server(String pop3Server)
pop3Server
- String getPOP3Server()
null
if a
POP3 connection is not used.setPOP3Server(java.lang.String)
void setPOP3SSL(boolean enabled)
EmailService
. If enabled, the POP3 connection will use the
TLS/SSL protocol when sending email.enabled
- true if the SSL protocol is enabled, false otherwiseboolean isPOP3SSL()
EmailService
will use the SSL protocol.EmailService
will
use the SSL protocol, false otherwise