mail Class
Mail facilitates , and is accessed via the global variable 'mail'.
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
StringFrom address
-
to
StringTo address
-
subject
StringSubject of the message
-
body
ObjectBody 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
ArrayArray of strings containing the paths in the virtual file-system of the files to be attached.
-
headers
ObjectName-value pairs of header variables.
Properties
smtp
Object
SMTP server configuration
Sub-properties:
-
serverName
StringHost-name or IP address of SMTP server.
-
port
StringPort of SMTP server.
-
userName
StringUser-name of account on SMTP server.
-
password
StringPassword of account on SMTP server.
-
enableSSL
BooleanSet to true if using SSL.