public final class EmailClient
extends java.lang.Object
Constructor and Description |
---|
EmailClient(java.lang.String outboundHostType,
java.lang.String outboundHost,
int outboundPort,
EmailEncryptionType encryption,
java.lang.String username,
java.lang.String password)
Prepares an Email Client to send email.
|
EmailClient(java.lang.String outboundHostType,
java.lang.String outboundHost,
int outboundPort,
java.lang.String username,
java.lang.String password)
Prepares an Email Client to send email.
|
Modifier and Type | Method and Description |
---|---|
SendableEmailMessage |
createMessage()
Creates a message that can be sent using the current client
|
java.lang.String |
getInboundHost()
Returns the name of the inbound mail server
|
java.lang.Integer |
getInboundPort()
Returns the port of the inbound mail server
|
java.lang.String |
getOutboundHost()
Returns the name of the outbound mail server
|
java.lang.Integer |
getOutboundPort()
Returns the port of the outbound mail server
|
void |
sendSimpleEmail(java.lang.String to,
java.lang.String subject,
java.lang.String message)
Sends a simple email to the client.
|
public EmailClient(@Nullable java.lang.String outboundHostType, java.lang.String outboundHost, int outboundPort, @Nullable java.lang.String username, @Nullable java.lang.String password)
outboundHostType
- The type of the host, such as 'smtp'outboundHost
- The name of the outbound mail serveroutboundPort
- The port used to connect to the outbound serverusername
- The username for the accountpassword
- The password for the accountpublic EmailClient(@Nullable java.lang.String outboundHostType, java.lang.String outboundHost, int outboundPort, @NotNull EmailEncryptionType encryption, @Nullable java.lang.String username, @Nullable java.lang.String password)
outboundHostType
- The type of the host, such as 'smtp'outboundHost
- The name of the outbound mail serveroutboundPort
- The port used to connect to the outbound serverusername
- The username for the accountpassword
- The password for the accountencryption
- The type of encryption used on the connectionpublic void sendSimpleEmail(@NotNull java.lang.String to, java.lang.String subject, java.lang.String message) throws javax.mail.MessagingException
to
- The address this message will be sent tosubject
- The subject of the emailmessage
- The message to send, as HTMLjavax.mail.MessagingException
- On any error setting message fields or sending the message@NotNull public SendableEmailMessage createMessage()
@Nullable public java.lang.String getOutboundHost()
@Nullable public java.lang.Integer getOutboundPort()
@Nullable public java.lang.String getInboundHost()
@Nullable public java.lang.Integer getInboundPort()