Skip to main content

Send a Failure Notification with a Send Mail Task

Declares an SMTP connection manager named 'SmtpServerConnection' (with SSL on) and a 'FailureNotifier' package whose 'SendMail' task uses it. The task is configured with high priority, a fixed from/to address pair, a subject, and a 'DirectInput' body string. Drop this task into the 'OnError' event handler of another package (or chain it after a failing task with a failure precedence constraint) so any failure produces an immediate email. Replace 'smtp.yourcompany.com' and the From/To addresses with your own values before deploying.

<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Connections>
<SmtpConnection Name="SmtpServerConnection" SmtpServer="smtp.yourcompany.com" EnableSsl="true"/>
</Connections>
<Packages>
<Package Name="FailureNotifier" ConstraintMode="Parallel">
<Tasks>
<SendMail
Name="Send Failure Mail Task"
ConnectionName="SmtpServerConnection"
FromLine="[email protected]"
Subject="There is a problem"
Priority="High"
>
<DirectInput>A package has unexpectedly failed! Please investigate.</DirectInput>
</SendMail>
</Tasks>
</Package>
</Packages>
</Biml>