microsoft-ssis.blogspot.com Open in urlscan Pro
2a00:1450:4001:80f::2001  Public Scan

Submitted URL: https://microsoft-ssis.blogspot.al/2013/08/sending-mail-within-ssis-part-1-send.html
Effective URL: https://microsoft-ssis.blogspot.com/2013/08/sending-mail-within-ssis-part-1-send.html
Submission: On April 26 via manual from GB — Scanned from GB

Form analysis 1 forms found in the DOM

https://microsoft-ssis.blogspot.com/search

<form action="https://microsoft-ssis.blogspot.com/search" class="gsc-search-box" target="_top">
  <table cellpadding="0" cellspacing="0" class="gsc-search-box">
    <tbody>
      <tr>
        <td class="gsc-input">
          <input autocomplete="off" class="gsc-input" name="q" size="10" title="search" type="text" value="">
        </td>
        <td class="gsc-search-button">
          <input class="gsc-search-button" title="search" type="submit" value="Search">
        </td>
      </tr>
    </tbody>
  </table>
</form>

Text Content

MICROSOFT SQL SERVER INTEGRATION SERVICES







TUESDAY 6 AUGUST 2013


SENDING MAIL WITHIN SSIS - PART 1: SEND MAIL TASK


Case
I want to send mail within SSIS, preferably HTML formatted. What are the
options?

Solutions

There are a couple of solutions to mail within SSIS:
 A. Send Mail Task
 B. Script Task with SmtpClient Class
 C. Execute SQL Task with sp_send_dbmail
 D. Custom Tasks like Send HTML Mail Task or COZYROC


To demonstrate the various solutions, I'm working with these four SSIS string
variables. They contain the subject, body, from- and to address. Add these
variables to your package and give them a suitable value. You could also use
parameters instead if you're using 2012 project deployment.


Add these four variables to your package











A) Send Mail Task
This is the standard task within SSIS to send mail. Good for simple plaintext
emails but there are a couple of drawbacks. First see how it works.

1) SMTP Connection Manager
Right click in the Connection Managers window and add an SMTP Connect manager.
Add the SMTP server. This is the first drawback. The settings are very limited.
Things like port or credentials can't be set.


SMTP Connection manager
















2) Send Mail Task
Add the Send Mail Task to the Control Flow (or to an event handler). Give it a
suitable name and on the Mail pane at SmtpConnection, select our new Connection
Manager.


Select SMTP Connection Manager
























3) Expressions
After selecting the Connection Manager (leave rest unchanged) go to the
Expressions pane and add an expression on the subject, body, to and from. Use
the variables to overwrite these fields. After this click OK to close the editor
and test it.


Expressions





















4) Testing
Now run the task and check the mailbox. Now you will see the second drawback.
The Send Mail Task doesn't support HTML formatted mail. So only plain text.


No HTML Formatting






















If you want to overcome the two drawbacks then you have to use one of the other
solutions. Next example solution: Script Task

Geplaatst door Joost van Rossum
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: MAIL, SSIS 2008, SSIS 2012


NO COMMENTS:





POST A COMMENT

Please use the SSIS MSDN forum for general SSIS questions that are not about
this post. I'm a regular reader of that forum and will gladly answer those
questions over there.

All comments are moderated manually to prevent spam.





Newer Post Older Post Home

Subscribe to: Post Comments (Atom)




SEARCH THIS BLOG




 * Home
 * Author
 * SSIS Addons
 * PowerShell
 * Azure blog
 * Azure Integration Services




AVAILABLE






BLOG ARCHIVE

 * ►  2021 (1)
   * ►  February (1)

 * ►  2020 (1)
   * ►  January (1)

 * ►  2019 (9)
   * ►  December (2)
   * ►  November (1)
   * ►  September (1)
   * ►  June (1)
   * ►  April (1)
   * ►  February (2)
   * ►  January (1)

 * ►  2018 (10)
   * ►  October (1)
   * ►  June (1)
   * ►  May (1)
   * ►  April (2)
   * ►  March (2)
   * ►  February (3)

 * ►  2017 (14)
   * ►  December (2)
   * ►  October (1)
   * ►  August (2)
   * ►  July (1)
   * ►  June (2)
   * ►  May (2)
   * ►  April (1)
   * ►  February (2)
   * ►  January (1)

 * ►  2016 (19)
   * ►  December (4)
   * ►  October (3)
   * ►  September (2)
   * ►  July (1)
   * ►  June (3)
   * ►  May (1)
   * ►  April (2)
   * ►  March (1)
   * ►  February (1)
   * ►  January (1)

 * ►  2015 (29)
   * ►  December (2)
   * ►  November (1)
   * ►  October (2)
   * ►  September (4)
   * ►  August (5)
   * ►  July (1)
   * ►  June (7)
   * ►  May (1)
   * ►  April (1)
   * ►  March (1)
   * ►  February (3)
   * ►  January (1)

 * ►  2014 (27)
   * ►  December (1)
   * ►  November (1)
   * ►  October (2)
   * ►  September (3)
   * ►  August (1)
   * ►  July (1)
   * ►  June (5)
   * ►  May (4)
   * ►  April (2)
   * ►  March (3)
   * ►  February (2)
   * ►  January (2)

 * ▼  2013 (28)
   * ►  December (2)
   * ►  November (1)
   * ►  October (1)
   * ►  September (1)
   * ▼  August (4)
     * Use Visual Studio 2012 for SSIS 2012
     * Sending mail within SSIS - Part 1: Send Mail Task
     * Sending mail within SSIS - Part 2: Script Task
     * Sending mail within SSIS - Part 3: Execute SQL Task
   * ►  July (3)
   * ►  June (2)
   * ►  May (1)
   * ►  April (4)
   * ►  March (1)
   * ►  February (2)
   * ►  January (6)

 * ►  2012 (38)
   * ►  December (5)
   * ►  November (2)
   * ►  October (6)
   * ►  September (4)
   * ►  August (4)
   * ►  July (3)
   * ►  June (2)
   * ►  May (1)
   * ►  April (4)
   * ►  March (2)
   * ►  February (2)
   * ►  January (3)

 * ►  2011 (53)
   * ►  December (2)
   * ►  November (2)
   * ►  October (1)
   * ►  September (2)
   * ►  August (3)
   * ►  July (5)
   * ►  June (3)
   * ►  May (3)
   * ►  April (5)
   * ►  March (5)
   * ►  February (9)
   * ►  January (13)

 * ►  2010 (17)
   * ►  December (17)




HIRE ME VIA






LABELS

ADF ADLS ADO AGGREGATE ALWAYS ON APS ASSEMBLY ASYNCHRONOUS AZURE BATCH FILE BDD
BEST PRACTICES BIML BUFFER BUG C# CACHE CAST CHECKSUM CODING CONVENTIONS COLLATE
CONFIGURATIONS CONNECTION MANAGER CONTINUOUSLY CONVERT CREDENTIAL CRM CUSTOM
DATA CONVERSION DATA TAP DEBUG DECRYPT DENALI CTP1 DENALI CTP3 DEVELOPMENT
DEVOPS DIMENSION DOWNLOAD DTUTIL ENCRYPT ENUMERATOR ENVIRONMENTS ERROR EVENTLOG
EVENTS EXCEL EXECUTE SQL TASK EXPORT COLUMN EXPRESSIONS FILE SYSTEM TASK FIX FOR
LOOP FOREACH LOOP FTP GIT GUID HDINSIGHT HEADER IMAGES IMEX IMPORT COLUMN
INDEXES ISNUMERIC JOB JOIN LAST MODIFIED LOOKUP MAIL MERGE ODATA PARALLELISM
PARAMETERS PERFORMANCE PIVOT POWERSHELL private PROPERCASE PROXY REFLECTION
REGEX RIJNDAEL SAS SCALE OUT SCHEDULE SCRIPT COMPONENT SCRIPT TASK SEQUENCE
CONTAINER SERVICES SLOWLY CHANGING DIMENSION SNIPPET SORT SOURCE SQL SQL SERVER
AGENT SQLRALLY SQLSAT SSDT SSIS SSIS 2005 SSIS 2008 SSIS 2012 SSIS 2014 SSIS
2016 SSIS 2016 CTP 2 SSIS 2016 CTP 3 SSIS VNEXT SSMS SYNCHRONOUS TASK TEMPLATE
TFS TIME DIMENSION TRAILER TRANSACTIONS TSQL UNPIVOT UPSERT VALIDATION VARIABLES
VB.NET WAIT WINDOWS SERVICE WMI EVENT WATCHER TASK XML XSD ZIP



LAST 30 DAYS

047159271355460574610075785894510571155124713431444154316271728183919352038213622332321242525512635273928382917



18,043



TWITTER





FOLLOWERS




POPULAR POSTS

 * Get packages from SSIS Catalog
 * Download source file from website with SSIS
 * Switch package from 64bit to 32bit
 * Custom SSIS Component: UnZip Task
 * The process cannot acces the file 'ssisproject.ispac' because it is being
   used by another process.





Awesome Inc. theme. Powered by Blogger.



Diese Website verwendet Cookies von Google, um Dienste anzubieten und Zugriffe
zu analysieren. Deine IP-Adresse und dein User-Agent werden zusammen mit
Messwerten zur Leistung und Sicherheit für Google freigegeben. So können
Nutzungsstatistiken generiert, Missbrauchsfälle erkannt und behoben und die
Qualität des Dienstes gewährleistet werden.Weitere InformationenOk