$k. SmtpConnection

new SmtpConnection()

Extends

Methods

authenticate(username, password)

Set the username and password

Parameters:
NameTypeDescription
usernamestring
passwordstring
Since
  • 4.0.3

authenticateFromEncrypedAccount(encryptedAccount)

Set the username and password from a volume encrypted authenication string

Parameters:
NameTypeDescription
encryptedAccountstring

Encrypted account (Base64 encoded string generated in the Admin-Tool)

Since
  • 5.2.1

send(message, asyncopt)

Sends the mail message.

Parameters:
NameTypeAttributesDescription
message$k.MailMessage

The mail message to send.

asyncboolean<optional>

True if the mail should be sent asynchronously, false if send() should block until the mail has been sent. Default is true.

Since
  • 5.5.1

setDefaultConfiguration()

Set configuration values from the SMTP settings of the Knowledge Graph.

Since
  • 5.5.1

setHost(host, portopt)

Set the hostname and port of the SMTP server.

Parameters:
NameTypeAttributesDescription
hoststring
portnumber<optional>
Since
  • 5.5.1

setRetries(retries)

Set the number of retries when trying to contact the SMTP server.

Parameters:
NameTypeDescription
retriesnumber

Number of retries

Since
  • 5.5.1

setRetryDelay(retryDelay)

Set the delay between trying to contact the SMTP server. Only used when retries is a non-zero value.

Parameters:
NameTypeDescription
retryDelaynumber

Delay in seconds

Since
  • 5.5.1

setTimeout(timeout)

Set the timeout in milliseconds for connection to wait for reponses

Parameters:
NameTypeDescription
timeoutnumber

number of milliseconds to wait for reponses, default 20000

Since
  • 4.2.0

setUserName(username)

Set the name of the user account. The password must be configured in the SMTP settings of the Knowledge Graph.

Parameters:
NameTypeDescription
usernamestring
Since
  • 5.5.1

useSMTPS()

Use SMTPS for connecting to the SMTP server.

Since
  • 5.5.1

useStartTLS()

Use STARTTLS for connecting to the SMTP server.

Since
  • 5.5.1

useUnsecureConnection()

Use an unsecure connection to the SMTP server. This is the default connection type.

Since
  • 5.5.1