Plugins can send email with the following API:

application.email plugin

sendMessage(message)
Sends the given message (of type Application.Email)
createMessage()
Convenience function to create an empty message
createMessage(to, subject)
Convenience function to create a message to the given address, with the given subject
createPlainTextMessage(to, subject, body)
Convenience function to create a plain-text message with the given body
createHtmlMessage(to, subject, html)
Convenience function to create a HTML message with the given body
testConnection()
Checks the connection to the server using the built-in settings
testConnection(settings)
Checks the connection to the server using the given settings

Type Definition: Application.Email

Mail messages are stored in CycleServer when messages are sent. They have the following format.

Attribute Value Type Status Description
ToAddress String or List Required The addresses to send the email to. Either a
comma-separated string, or a list or addresses
CcAddress String or List Optional The addresses to CC the email on. Either a
comma-separated string, or a list or addresses
BccAddress String or List Optional The addresses to BCC the email on. Either a
comma-separated string, or a list or addresses
FromAddress String Optional The address this email will be from. Defaults to the
global setting
Subject String Optional The subject for this email
Body String Optional The body of this email
MimeType String Optional The MIME type of this email. Defaults to “text/plain”
Id Identifier Automatic Uniquely identifies this email message
SentDate AbsTime Automatic The time this email was sent
Status String Automatic “sent” if sent successfully; “error” if not

System Settings

The email settings are stored in Application.Setting records. Each setting corresponds to a single record with the name of the setting and the value stored under the Name and Value attributes, respectively.

Attribute Value Type Status Description
email.hostname String Required The hostname of the email server to connect to
email.username String Optional The username for authentication, if needed
email.password String Optional The password for authentication, if needed
email.port Integer Optional The port to connect to. Undefined for default
email.ssl Boolean Optional Whether to use SSL or not
email.from String Optional The default address to use as From