Mail new - Axiom

The mail object provides an interface for sending email via SMTP.

It is instantiated as follows:

var m = new Mail();

A valid SMTP server must first be specified in app.properties in order for this to function properly. The line that needs to be added is as follows:

smtp = smtp.example.com

Below are the methods available.

Contents

Mail.addBCC()

Description

Mail.addBCC(email, name)

Add a recipient to the current message. (Blind Copy)

Parameters

  • email (String) - The email address of the new recipient.
  • name (String, Optional) - The name of the new recipient.


Mail.addCC()

Description

Mail.addCC(email, name)

Add a recipient to the current message. (Copy)

Parameters

  • email (String) - The email address of the new recipient.
  • name (String, Optional) - The name of the new recipient.


Mail.addPart()

Description

Mail.addPart(part, name)

Attach a file or mime object to the current email.

Parameters

  • part (File or MimePart) - The file to attach.
  • name (String, Optional) - Name of attachment.


Mail.addText()

Description

Mail.addText(text)

Adds text to the body of the current email.

Parameters

  • text (String) - The text to add.


Mail.addTo()

Description

Mail.addTo(email, name)

Adds a recipient to the email.

Parameters

  • email (String) - The email address of the new recipient.
  • name (String, Optional) - The name of the new recipient.


Mail.send()

Description

Mail.send()

Sends the current email.


Mail.setFrom()

Description

Mail.setFrom(email, name)

Set the sender of the current email.

Parameters

  • email (String) - The email address of the new recipient.
  • name (String, Optional) - The name of the new recipient.


Mail.setSubject()

Description

Mail.setSubject(text)

Set the subject of the email.

Parameters

  • text (String) - The text to set.


Mail.setTo()

Description

Mail.setTo(email, name)

Set the recipient of the current email.

Parameters

  • email (String) - The email address of the new recipient.
  • name (String, Optional) - The name of the new recipient.