Receive Mail Task

Overview

Receive Mail Task is SSIS Control Flow task for receiving e-mails. The task can also decrypt and verify signatures of S/MIME mails.

Setup

Use the General page of the Receive Mail Task Editor dialog to configure the options needed to receive e-mails.

Options

Name

Specify task name.

Description

Specify task description.

StopOnFailure

Specify whether the Receive Mail Task terminates if action fails.

Action

Specify task action. This property has the options listed in the following table.

Value Description
Get mail Downloads mail to a local file. Selecting this value displays the dynamic options IsLocalVariable, Local, LocalVariable, OverwriteExisting, MailConnection, MailVariable.
Open mail Opens mail file. Selecting this value displays the dynamic options IsLocalVariable, Local, LocalVariable, Decrypt, VerifySignature, IsSenderVariable, Sender, SenderVariable, IsDateVariable, Date, DateVariable, IsSubjectVariable, Subject, SubjectVariable, IsBodyTextVariable, BodyText, BodyTextVariable, IsBodyHtmlVariable, BodyHtml, BodyHtmlVariable, IsAttachmentVariable, Attachment, AttachmentVariable.
Delete mail Deletes mail. Selecting this value displays the dynamic options MailConnection, MailVariable.
Get mails list Gets mails list. Selecting this value displays the dynamic options ResultVariable, MailConnection, IsFilterVariable, Filter, FilterVariable.
IsLocalVariable

Indicates whether the local path is stored in a variable. This property has the options listed in the following table.

Value Description
True The local path is stored in a variable. Selecting the value displays the dynamic option LocalVariable.
False The local path is specified in a File connection manager. Selecting the value displays the dynamic option Local.
Local

Select an existing File connection manager, or click <New connection...> to create a connection manager.

Related topics: File Connection Manager Editor

LocalVariable

Select an existing user-defined variable, or click <New variable...> to create a variable.

Related Topics: Integration Services Variables, Add Variable

OverwriteExisting

Specify whether local file can be overwritten.

MailConnection

Select an existing POP3 connection manager or IMAP connection manager, or click <New connection...> to create a connection manager.

Related Topics: POP3 Connection Manager, IMAP Connection Manager

MailVariable

Mail information object. Select an existing user-defined variable, or click <New variable...> to create a variable.

Related Topics: Integration Services Variables, Add Variable

Decrypt

Indicates whether the mail has to be decrypted. This property has the options listed in the following table.

Value Description
True The mail has to be decrypted. Selecting the value displays the dynamic options IsPrivateKeyVariable, PrivateKey, PrivateKeyVariable, Password.
False The mail is not encrypted.
IsPrivateKeyVariable

Indicates whether the private key file path is stored in a variable. This property has the options listed in the following table.

Value Description
True The private key file path is stored in a variable. Selecting the value displays the dynamic option PrivateKeyVariable.
False The private key file is specified in a File connection manager. Selecting the value displays the dynamic option PrivateKey.
PrivateKey

Select an existing File connection manager, or click <New connection...> to create a connection manager.

Related topics: File Connection Manager Editor

PrivateKeyVariable

Select an existing user-defined variable, or click <New variable...> to create a variable.

Related Topics: Integration Services Variables, Add Variable

Password

Specify private key password.

VerifySignature

Indicates whether mail signature is verified. This property has the options listed in the following table.

Value Description
True The mail signature is verified. Selecting the value displays the dynamic options , IsCertificateVariable, Certificate, CertificateVariable.
False The mail signature is not verified.
IsCertificateVariable

Indicates whether the certificate file path is stored in a variable. This property has the options listed in the following table.

Value Description
True The certificate file path is stored in a variable. Selecting the value displays the dynamic option CertificateVariable.
False The certificate file path is specified in a File connection manager. Selecting the value displays the dynamic option Certificate.
Certificate

Select an existing File connection manager, or click <New connection...> to create a connection manager.

Related topics: File Connection Manager Editor

CertificateVariable

Select an existing user-defined variable, or click <New variable...> to create a variable.

Related Topics: Integration Services Variables, Add Variable

IsSenderVariable (1.5 SR-3)

Indicates whether the mail sender is stored in a variable. This property has the options listed in the following table.

Value Description
True The mail sender is stored in a variable. Selecting the value displays the dynamic option SenderVariable.
False The mail sender is stored in a file and is specified in a File connection manager. Selecting the value displays the dynamic option Sender.
Sender (1.5 SR-3)

Select an existing File connection manager, or click <New connection...> to create a connection manager.

Related topics: File Connection Manager Editor

SenderVariable (1.5 SR-3)

Select an existing user-defined variable, or click <New variable...> to create a variable.

Related Topics: Integration Services Variables, Add Variable

IsDateVariable (1.5 SR-3)

Indicates whether the mail origination date is stored in a variable. This property has the options listed in the following table.

Value Description
True The mail date is stored in a variable. Selecting the value displays the dynamic option DateVariable.
False The mail date is stored in a file and is specified in a File connection manager. Selecting the value displays the dynamic option Date.
Date (1.5 SR-3)

Select an existing File connection manager, or click <New connection...> to create a connection manager.

Related topics: File Connection Manager Editor

DateVariable (1.5 SR-3)

Select an existing user-defined variable, or click <New variable...> to create a variable.

Related Topics: Integration Services Variables, Add Variable

IsSubjectVariable

Indicates whether the mail subject is stored in a variable. This property has the options listed in the following table.

Value Description
True The mail subject is stored in a variable. Selecting the value displays the dynamic option SubjectVariable.
False The mail subject is stored in a file and is specified in a File connection manager. Selecting the value displays the dynamic option Subject.
Subject

Select an existing File connection manager, or click <New connection...> to create a connection manager.

Related topics: File Connection Manager Editor

SubjectVariable

Select an existing user-defined variable, or click <New variable...> to create a variable.

Related Topics: Integration Services Variables, Add Variable

IsBodyTextVariable

Indicates whether the mail body text is stored in a variable. This property has the options listed in the following table.

Value Description
True The mail body text is stored in a variable. Selecting the value displays the dynamic option BodyTextVariable.
False The mail body text is stored in a file and is specified in a File connection manager. Selecting the value displays the dynamic option BodyText.
BodyText

Select an existing File connection manager, or click <New connection...> to create a connection manager.

Related topics: File Connection Manager Editor

BodyTextVariable

Select an existing user-defined variable, or click <New variable...> to create a variable.

Related Topics: Integration Services Variables, Add Variable

IsBodyHtmlVariable

Indicates whether the mail HTML body is stored in a variable. This property has the options listed in the following table.

Value Description
True The mail HTML body is stored in a variable. Selecting the value displays the dynamic option BodyHtmlVariable.
False The mail HTML body is stored in a file and is specified in a File connection manager. Selecting the value displays the dynamic option BodyHtml.
BodyHtml

Select an existing File connection manager, or click <New connection...> to create a connection manager.

Related topics: File Connection Manager Editor

BodyHtmlVariable

Select an existing user-defined variable, or click <New variable...> to create a variable.

Related Topics: Integration Services Variables, Add Variable

IsAttachmentVariable

Indicates whether the mail attachments folder is stored in a variable. This property has the options listed in the following table.

Value Description
True The mail attachments folder is stored in a variable. Selecting the value displays the dynamic option AttachmentVariable.
False The mail attachments folder is specified in a File connection manager. Selecting the value displays the dynamic option Attachment.
Attachment

Select an existing File connection manager, or click <New connection...> to create a connection manager.

Related topics: File Connection Manager Editor

AttachmentVariable

Select an existing user-defined variable, or click <New variable...> to create a variable.

Related Topics: Integration Services Variables, Add Variable

ResultVariable

Select an existing user-defined variable, or click <New variable...> to create a variable.

Related Topics: Integration Services Variables, Add Variable

IsFilterVariable

Indicates whether the mail filter criteria is stored in a variable. This property has the options listed in the following table.

Value Description
True The mail filter criteria is stored in a variable. Selecting the value displays the dynamic option FilterVariable.
False The mail filter criteria is directly specified. Selecting the value displays the dynamic option Filter.
Filter

Specify mail filter criteria. The filter expression for each connection type is as follows:

Connection Description
POP3

FLEE expression. You can use the following elements: ID, Date, Size, From, To, CC, ReplyTo, Subject, BodyText, BodyHtml, HasAttachments.

For example to get all e-mails after 10 Sep 2009, containing "data" in the subject use the following expression: date > #09/10/2009# and subject.contains("data")

Note: Because the filter process is done on the client side be careful what elements you use in your expressions. Using BodyText, BodyHtml and HasAttachments elements will require complete mail retrieval.

IMAP IMAP SEARCH COMMAND expression.
FilterVariable

Select an existing user-defined variable, or click <New variable...> to create a variable.

Related Topics: Integration Services Variables, Add Variable

Samples

  • For a sample how to process and iterate over mail information, check this package.
  • To read and process mail information inside data flow, check this reusable script.