Client: SmtpClient

Isolated

Represents an SMTP Client, which interacts with an SMTP Server.

Constructor

Gets invoked during the email:SmtpClient initialization.

init (string host, string username, string password, *SmtpConfiguration clientConfig)
  • host string
  • Host of the SMTP Client

  • username string
  • Username of the SMTP Client

  • password string
  • Password of the SMTP Client

Remote Methods

sendMessage

Sends an email message.

send

Sends an email message with optional parameters.

sendMessage

function sendMessage(Message email) returns Error?
Isolated Function
Remote Function

Sends an email message.

1email:Error? response = smtpClient->sendMessage(email);

Parameters

  • email Message
  • An email:Message message, which needs to be sent to the recipient

Return Type

(Error?)

An email:Error if failed to send the message to the recipient or else ()

send

function send(string | string[ ] to, string subject, string 'from, string body, *Options options) returns Error?
Isolated Function
Remote Function

Sends an email message with optional parameters.

1email:Error? response = smtpClient->send(toAddress, subject, fromAddress,
2 emailBody, sender="eve@abc.com");

Parameters

  • subject string
  • Subject of email

  • body string
  • Text body of the email

  • options *Options
  • Optional parameters of the email

Return Type

(Error?)

An email:Error if failed to send the message to the recipient or else ()