Skip to main content
Class for representing and sending emails.

Constructors

Email()

Initializes a new instance of the Email class.

Methods

addAttachment(Integer,Bool)

Adds an attachment to the email object.
Returns: CRMScript.Global.String - The ID of the attachment relative to the email.

send()

Sends the email.
Returns: CRMScript.Global.Void

setValue(String,String)

Sets the value of the given field in the email instance. For multiple recipients, call setValue multiple times, once for each recipient.
Returns: CRMScript.Global.Void
Available fields:
  • from: The from address.
  • to: The recipient.
  • cc: The carbon copy recipient.
  • bcc: The bcc recipient.
  • sms: A cellphone number to send sms to.
  • smsFrom: The from address when sending sms.
  • subject: The subject of the email.
  • body: The plain text body of the email.
  • bodyHtml: The HTML formated body of the email.
  • ticketId: The ticketId, only used with sms.</p
  • envelopeFrom
  • Sets the envelope from mail address. “From” will also be set if not already set
><p>From version 8.1 any other header value may also be added, for example setValue(“X-Foo”, “42”);