1

In SSIS can we Send email using Data Flow Output Column. And If Condition is Met I want to Send Email. I want to is it possible? If it is possible then how can we do that?

If anyone know please let me know.. Thanks in advance!

Hadi
  • 36,233
  • 13
  • 65
  • 124
  • Can you output to a variable? Do a split on your data flow and have one go wherever you want and the other into a variable? If multiple rows, put into an object type – Brad Aug 02 '19 at 14:45
  • Can you explain some about why it must be sent within a data flow? – jamie Aug 05 '19 at 23:50

2 Answers2

1

As @TabAlleman mentioned, the only way is using a Script Component. You can refer the following link for sending email using a C# script:

System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.To.Add("luckyperson@online.microsoft.com");
message.Subject = "This is the Subject line";
message.From = new System.Net.Mail.MailAddress("From@online.microsoft.com");
message.Body = "This is the message body";
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("yoursmtphost");
smtp.Send(message);

Code Reference

Similar Issue

Hadi
  • 36,233
  • 13
  • 65
  • 124
0

The only way I know is to use a script transformation.

Tab Alleman
  • 31,483
  • 7
  • 36
  • 52