SendMailTask Object (DTS)

The SendMailTask object contains information that lets you send an e-mail as a task. For example, if you want to notify a database administrator regarding the success or failure of a particular task (such as a backup), you can link a SendMailTask object with a precedence constraint to the previous task. To use a SendMailTask, the computer needs to have the Microsoft messaging API installed with a valid user profile.

A SendMailTask can include attached data files. You can point to a location for an attached file and send a dynamically updated file, rather than a static copy of the file fixed when you create the task. This feature is useful for sending attachments such as log files and exception files, which contain information that constantly changes, and for which the file may not exist when the package is created (at design time).


Note If you enter an attachment file name and path that does not exist when the package is run, you receive the message: “Error sending mail: Internal MAPI error: the address book has no directories that contain names.” This message simply indicates the absence of the file at the specified location, or that access permissions are not granted for the file. To fix the error, make sure that the file is available at the specified location when the package is run, or that access is granted.


Methods
Execute Method Logon Method
GetDefaultProfileName Method ResolveName Method
InitializeMAPI Method ShowAddressBook Method
Logoff Method UninitializeMAPI Method

Properties
CCLine Property Name Property
Description Property Password Property
FileAttachments Property SaveMailInSentItemsFolder Property
IsNTService Property Subject Property
MessageText Property ToLine Property

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.