Partilhar via


Send Mail Task

The Send Mail task sends an e-mail message. By using the Send Mail task, a package can send messages if tasks in the package workflow succeed or fail, or send messages in response to an event that the package raises at run time. For example, the task can notify a database administrator about the success or failure of the Backup Database task.

You can configure the Send Mail task in the following ways:

  • Provide the message text for the e-mail message.

  • Provide a subject line for the e-mail message.

  • Set the priority level of the message. The task supports three priority levels: normal, low, and high.

  • Specify the recipients on the To, Cc, and Bcc lines. If the task specifies multiple recipients, they are separated by semicolons.

    Note

    The To, Cc, and Bcc lines are limited to 256 characters each in accordance with Internet standards.

  • Include attachments. If the task specifies multiple attachments, they are separated by the pipe (|) character.

    Note

    If an attachment file does not exist when the package runs, an error occurs.

  • Specify the SMTP connection manager to use.

The message text can be a string that you provide, a connection to a file that contains the text, or the name of a variable that contains the text. The task uses a File connection manager to connect to a file. For more information, see Flat File Connection Manager.

The task uses an SMTP connection manager to connect to a mail server. For more information, see SMTP Connection Manager.

Integration Services includes a task that uses Message Queuing to send and receive messages between packages.

For more information about this task, click the following topic:

Custom Logging Messages Available on the Send Mail Task

The following table lists the custom log entries for the Send Mail task. For more information, see Implementing Logging in Packages and Custom Messages for Logging.

Log entry Description

SendMailTaskBegin

Indicates that the task began to send an e-mail message.

SendMailTaskEnd

Indicates that the task finished sending an e-mail message.

SendMailTaskInfo

Provides descriptive information about the task.

Configuring the Send Mail Task

You can set properties through SSIS Designer or programmatically.

For more information about the properties that you can set in SSIS Designer, click one of the following topics:

For more information about how to set these properties in SSIS Designer, click of the following topic:

Configuring the Send Mail Task Programmatically

For more information about programmatically setting these properties, click the following topic:

See Also

Concepts

Integration Services Tasks
Creating Package Control Flow

Help and Information

Getting SQL Server 2005 Assistance

Change History

Release History

17 July 2006

Changed content:
  • Added table of custom log entries.

14 April 2006

Changed content:
  • Added Note specifying maximum length of Cc, Bcc, and To lines.