public class SMTPDClient extends Object implements SenderDClient
SenderDClient.
It provides opportunities for sending email messages using the SMTP protocol. An SMTP connection will be
established by creating the class at once.
You should use the instance of the SmtpProperties class, for configure this class.
| Constructor and Description |
|---|
SMTPDClient(SmtpProperties smtpProperties)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
jakarta.mail.Session |
connect()
Connects to the email server using the SMTP protocol.
|
EmailParticipant |
getPrincipal()
Returns name and email address used for connection.
|
String |
getProtocolName()
Returns a using protocol name.
|
SendingStatus |
send(OutgoingMessage message)
It sends to message.
|
public SMTPDClient(SmtpProperties smtpProperties)
smtpProperties - the properties for connecting to an SMTP serverpublic jakarta.mail.Session connect()
throws SessionException
connect in interface DClientSession objectSessionException - The connection to the server has failed. The properties are broken.public final String getProtocolName()
getProtocolName in interface DClientpublic final EmailParticipant getPrincipal()
getPrincipal in interface DClientpublic SendingStatus send(OutgoingMessage message)
send in interface SenderDClientmessage - the message objectSendingStatusCopyright © 2023. All rights reserved.