API Docs for:
Show:

mail Class

Module: API

Mail facilitates , and is accessed via the global variable 'mail'.

Item Index

Methods

Properties

Methods

send

(
  • from
  • to
  • subject
  • body
  • attachments
  • headers
)

Sends an e-mail message via SMTP as configured by the smtp object of this class. The body of the message may be a simple string (plain-text) or an object defining a multi-part MIME encoded message (see below). Attachments from the CompleteFTP virtual file-system may also be added.

Parameters:

  • from String

    From address

  • to String

    To address

  • subject String

    Subject of the message

  • body Object

    Body of the message. This may either be a simple string or an object. If it's an object then a MIME multi-part message will be generated. One part will be generated for each property. The MIME type of the part is determined by the name of the property, e.g. the property "textPlain" becomes the type "text/plain", and "textHtml" becomes "text/html". The content of a part is the stringified value of the corresponding property value.

  • attachments Array

    Array of strings containing the paths in the virtual file-system of the files to be attached.

  • headers Object

    Name-value pairs of header variables.

Properties

smtp

Object

SMTP server configuration

Sub-properties:

  • serverName String

    Host-name or IP address of SMTP server.

  • port String

    Port of SMTP server.

  • userName String

    User-name of account on SMTP server.

  • password String

    Password of account on SMTP server.

  • enableSSL Boolean

    Set to true if using SSL.