EmailAction object

[This object is no longer supported. Please use IExecAction with the powershell Send-MailMessage cmdlet as a workaround.]

Scripting object that represents an action that sends an email message.

Members

The EmailAction object has these types of members:

Properties

The EmailAction object has these properties.

Property Access type Description
Attachments
Read/write
Gets or sets an array of attachments that is sent with the email message.
Bcc
Read/write
Gets or sets the email address or addresses that you want to Bcc in the email message.
Body
Read/write
Gets or sets the body of the email that contains the email message.
Cc
Read/write
Gets or sets the email address or addresses that you want to Cc in the email message.
From
Read/write
Gets or sets the email address that you want to send the email from.
HeaderFields
Read/write
Gets or sets the header information in the email that you want to send.
Id
Read/write
Inherited from the Action object. Gets or sets the identifier of the action.
ReplyTo
Read/write
Gets or sets the email address that you want to reply to.
Server
Read/write
Gets or sets the name of the server that you use to send email from.
Subject
Read/write
Gets or sets the subject of the email message.
To
Read/write
Gets or sets the email address or addresses that you want to send the email to.
Type
Read-only
Inherited from Action object. Gets the type of the action.

Remarks

The email action must have a valid value for the Server, From, and To or Cc properties for the task to register and run correctly.

When reading or writing your own XML for a task, an email action is specified using the SendEmail element of the Task Scheduler schema.

Examples

For more information and example code for this scripting object, see Event Trigger Example (Scripting).

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
End of client support
Windows 7
End of server support
Windows Server 2008 R2
Type library
Taskschd.tlb
DLL
Taskschd.dll