GlideEmailOutbound - Scoped

The scoped GlideEmailOutbound class implements the email object for scoped applications. You can use the GlideEmailOutbound methods with the email global object available in mail scripts. The email object behaves identically for global and scoped applications.

Scoped GlideEmailOutbound - addAddress( String type, String address)

Adds the address to either the cc or bcc list.

Table 1. Parameters
Name Type Description
type String Either cc or bcc, determines the list to which the address is added.
address String The recipient's email address.
Table 2. Returns
Type Description
void

email.addAddress('cc', 'joe.employee@something.com');

Scoped GlideEmailOutbound - addAddress(String type, String address, String displayName)

Adds the recipient to either the cc or bcc list, but uses the display name instead of the address when showing the recipient.

Table 3. Parameters
Name Type Description
type String Either cc or bcc, determines the list to which the address is added.
address String The recipient's email address.
displayName String The name to be shown instead of the email address.
Table 4. Returns
Type Description
void

email.addAddress('bcc', 'joe.employee@something.com', 'dudley rocks');

Scoped GlideEmailOutbound - getSubject()

Returns the email's subject line.

Table 5. Parameters
Name Type Description
None
Table 6. Returns
Type Description
String The email's subject line.

var subject = email.getSubject();

Scoped GlideEmailOutbound - GlideEmailOutbound()

Instantiates a scoped GlideEmailOutbound object.

Table 7. Parameters
Name Type Description
None

var e = new GlideEmailOutbound();

Scoped GlideEmailOutbound - setBody(String bodyText)

Sets the body of the email.

Table 8. Parameters
Name Type Description
bodyText String The body of the email.
Table 9. Returns
Type Description
void

email.setBody('Dear Sir, ...');

Scoped GlideEmailOutbound - setFrom(String address)

Sets the sender's address.

Table 10. Parameters
Name Type Description
address String The sender's email address.
Table 11. Returns
Type Description
void

email.setFrom('joe.employee@something.com');

Scoped GlideEmailOutbound - setReplyTo(String address)

Sets the reply to address.

Table 12. Parameters
Name Type Description
address String The reply to email address.
Table 13. Returns
Type Description
void

email.setReplyTo('joe.employee@something.com');

Scoped GlideEmailOutbound - setSubject(String subject)

Sets the email's subject line.

Table 14. Parameters
Name Type Description
subject String Text for the subject line.
Table 15. Returns
Type Description
void

email.setSubject('Important Issues to discuss');