4.2.1

Table Of Contents
Mail Plug-In Scripting API
The Mail scripting API contains one class, with its respective attributes and methods, that allow vCenter
Orchestrator workflows to send email messages. You can use the API to develop custom workflows.
EmailMessage Class
The EmailMessage class is the main class for creating email messages that you want to send from workflows.
The EmailMessage class defines the following attributes.
Attribute Returns Description
bccAddress String
Comma-separated list of blind carbon
copy email address entries
ccAddress String
Comma-separated list of carbon copy
email address entries
fromAddress String
Sender's email address
fromName String
Sender's name
password String
Password for authentication
smtpHost String
SMTP host name or IP address
smtpPort Number
SMTP port number (default is 25)
subject String
Email subject
toAddress String
Comma-separated list of email address
entries
username String
User name for authentication
The EmailMessage class defines the following methods.
Method Returns Description
addMimePart(Object,String):void Void
Adds a MIME part to the message.
sendMessage():void Void
Sends an email message.
Email Scripting Examples
Workflow scripted elements can include scripting of common email-related tasks. You can cut, paste, and adapt
these examples into your scripted elements.
When you run a mail workflow, it uses the default mail server configuration that you set in the Orchestrator
configuration interface. You can override the default values by using input parameters, or by defining custom
values in workflow scripted elements.
Obtain an Email Address
The following JavaScript example obtains the email address of the current owner of a running script.
var emailAddress = Server.getRunningUser().emailAddress ;
Using VMware vCenter Orchestrator Plug-Ins
60 VMware, Inc.