Overview

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


Demonstration


    Setup

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

    Parameters

    Specify the task name.

    Specify the task description.

    Specify whether or not the Receive Mail Task terminates if the chosen action fails.

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

    Option Description
    Get mail Downloads mail to a local file. Selecting this action displays the dynamic parameters IsLocalVariable, Local, LocalVariable, OverwriteExisting, MailConnection, MailVariable.
    Open mail Opens the mail file. Selecting this action displays the dynamic parameters 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 the mail. Selecting this action displays the dynamic parameters MailConnection, MailVariable.
    Get mail list Gets a list of e-mails. Selecting this action displays the dynamic parameters ResultVariable, MailConnection, IsFilterVariable, Filter, FilterVariable.

    Indicate whether or not the local path is stored in a variable. This parameter has the options listed in the following table.

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

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

    Related topics: File Connection Manager Editor

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

    Related Topics: Integration Services Variables, Add Variable

    Specify whether or not an existing local file can be overwritten with the received mail. This parameter has the options listed in the following table.

    Option Description
    True If an existing local file exists, it will be overwritten by the received mail.
    False If an existing local file exists, it will not be overwritten by the received mail and a warning message will be generated in the log file.

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

    Related Topics: IMAP Connection Manager, Exchange Connection Manager 1.6, POP3 Connection Manager

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

    Related Topics: Integration Services Variables, Add Variable

    Indicate whether or not the mail must be decrypted. This parameter has the options listed in the following table.

    Option Description
    True The mail must be decrypted. Selecting this option displays the dynamic parameters IsPrivateKeyVariable, PrivateKey, PrivateKeyVariable, Password.
    False The mail is not encrypted so it need not be decrypted.

    Indicate whether the file path of the private key is stored in a variable. This parameter has the options listed in the following table.

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

    Specify the File connection manager where the file path of the private key is specified. Select an existing File connection manager, or click <New connection...> to create a new connection manager.

    Related topics: File Connection Manager Editor

    Specify the variable where the file path of the private key is specified. Select an existing user-defined variable, or click <New variable...> to create a new variable.

    Related Topics: Integration Services Variables, Add Variable

    Specify the private key password.

    Indicate whether or not the mail signature must be verified. This parameter has the options listed in the following table.

    Option Description
    True Verify the mail signature. Selecting this option displays the dynamic parameters , IsCertificateVariable, Certificate, CertificateVariable.
    False Do not verify the mail signature.

    Indicate whether or not the file path of the certificate is stored in a variable. This parameter has the options listed in the following table.

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

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

    Related topics: File Connection Manager Editor

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

    Related Topics: Integration Services Variables, Add Variable

    Indicate whether or not the sender of the mail should be stored in a variable. This parameter has the options listed in the following table.

    Option Description
    True The sender of the mail should be stored in a variable. Selecting this option displays the dynamic parameter SenderVariable.
    False The sender of the mail should be stored in a file and is specified in a File connection manager. Selecting this option displays the dynamic parameter Sender.

    Specify the file where the sender of the mail should be stored. Select an existing File connection manager, or click <New connection...> to create a new connection manager.

    Related topics: File Connection Manager Editor

    Specify the variable where the sender of the mail should be stored. Select an existing user-defined variable, or click <New variable...> to create a new variable.

    Related Topics: Integration Services Variables, Add Variable

    Indicate whether or not the origination date of the mail should be stored in a variable. This parameter has the options listed in the following table.

    Option Description
    True The origination date of the mail should be stored in a variable. Selecting this option displays the dynamic parameter DateVariable.
    False The origination date of the mail should be stored in a file and is specified in a File connection manager. Selecting this option displays the dynamic parameter Date.

    Specify the file in which the origination date of the mail should be stored. Select an existing File connection manager, or click <New connection...> to create a new connection manager.

    Related topics: File Connection Manager Editor

    Specify the variable in which the origination date of the mail should be stored. Select an existing user-defined variable, or click <New variable...> to create a new variable.

    Related Topics: Integration Services Variables, Add Variable

    Indicate whether or not the subject line of the mail should be stored in a variable. This parameter has the options listed in the following table.

    Option Description
    True The subject line of the mail should be stored in a variable. Selecting this option displays the dynamic parameter SubjectVariable.
    False The subject line of the mail should be stored in a file and is specified in a File connection manager. Selecting this option displays the dynamic parameter Subject.

    Specify the file in which the subject line of the mail should be stored. Select an existing File connection manager, or click <New connection...> to create a new connection manager.

    Related topics: File Connection Manager Editor

    Specify the variable in which the subject line of the the mail should be stored. Select an existing user-defined variable, or click <New variable...> to create a new variable.

    Related Topics: Integration Services Variables, Add Variable

    Indicate whether or not the text of the body of the mail should be stored in a variable. This parameter has the options listed in the following table.

    Option Description
    True The text of the body of the mail should be stored in a variable. Selecting this option displays the dynamic parameter BodyTextVariable.
    False The text of the body of the mail should be stored in a file and is specified in a File connection manager. Selecting this option displays the dynamic parameter BodyText.

    Specify the file in which the text of the body of the mail should be stored. Select an existing File connection manager, or click <New connection...> to create a new connection manager.

    Related topics: File Connection Manager Editor

    Specify the variable in which the text of the body of the mail should be stored. Select an existing user-defined variable, or click <New variable...> to create a new variable.

    Related Topics: Integration Services Variables, Add Variable

    Indicate whether or not the HTML of the body of the mail should be stored in a variable. This parameter has the options listed in the following table.

    Option Description
    True The HTML of the body of the mail should be stored in a variable. Selecting this option displays the dynamic parameter BodyHtmlVariable.
    False The HTML of the body of the mail should be stored in a file and is specified in a File connection manager. Selecting this option displays the dynamic parameter BodyHtml.

    Specify the file where the HTML of the body of the mail should be stored. Select an existing File connection manager, or click <New connection...> to create a new connection manager.

    Related topics: File Connection Manager Editor

    Specify the variable where the HTML of the body of the mail should be stored. Select an existing user-defined variable, or click <New variable...> to create a new variable.

    Related Topics: Integration Services Variables, Add Variable

    Indicate whether or not the mail attachments folder is stored in a variable. This parameter has the options listed in the following table.

    Option Description
    True The mail attachments folder should be stored in a variable. Selecting this option displays the dynamic parameter AttachmentVariable.
    False The mail attachments folder should be specified in a File connection manager. Selecting this option displays the dynamic parameter Attachment.

    Specify the File connection manager in which the mail attachments folder should be specified. Select an existing File connection manager, or click <New connection...> to create a new connection manager.

    Related topics: File Connection Manager Editor

    Specify the variable in which the mail attachments folder should be specified. Select an existing user-defined variable, or click <New variable...> to create a new variable.

    Related Topics: Integration Services Variables, Add Variable

    Specify the variable where the returned list of mail should be stored. Select an existing user-defined variable, or click <New variable...> to create a new variable.

    Related Topics: Integration Services Variables, Add Variable

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

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

    Specify the 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 line, 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.
    EXCHANGE 1.6 Exchange AQS expression.

    Specify the variable in which the mail filter criteria is stored. Select an existing user-defined variable, or click <New variable...> to create a new variable.

    Related Topics: Integration Services Variables, Add Variable


    Related scripts


    Samples

    • For a sample showing how to process and iterate over mail information, check this package.
    • Email Attachment Harvesting using COZYROC SSIS+ by Greg Troyan.

    Related documentation