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:
-
fromStringFrom address
-
toStringTo address
-
subjectStringSubject of the message
-
bodyObjectBody 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.
-
attachmentsArrayArray of strings containing the paths in the virtual file-system of the files to be attached.
-
headersObjectName-value pairs of header variables.
Properties
smtp
Object
SMTP server configuration
Sub-properties:
-
serverNameStringHost-name or IP address of SMTP server.
-
portStringPort of SMTP server.
-
userNameStringUser-name of account on SMTP server.
-
passwordStringPassword of account on SMTP server.
-
enableSSLBooleanSet to true if using SSL.
