Answered by:
Sending Email

Question
-
<html> I have a table with a list of email address. I want to send email to all the receipients, at one shot, using script task. I don't want to send an email one by one. I want to use script task because the message is a formatted HTML. How to do it. Thanks. </html>
NSG12Tuesday, March 29, 2011 8:32 PM
Answers
-
You could use the SmtpClient class:
http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspxAlso see the Related Topics part on the left side. For example: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/2bb3d10b-9f1d-446f-8db0-b7f47510a7c9
Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com- Proposed as answer by Todd McDermid Tuesday, March 29, 2011 9:46 PM
- Marked as answer by Tony Chain Wednesday, April 6, 2011 2:42 PM
Tuesday, March 29, 2011 9:01 PM
All replies
-
You could use the SmtpClient class:
http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspxAlso see the Related Topics part on the left side. For example: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/2bb3d10b-9f1d-446f-8db0-b7f47510a7c9
Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com- Proposed as answer by Todd McDermid Tuesday, March 29, 2011 9:46 PM
- Marked as answer by Tony Chain Wednesday, April 6, 2011 2:42 PM
Tuesday, March 29, 2011 9:01 PM -
Thank you.
NSG12Tuesday, March 29, 2011 9:38 PM -
Wednesday, March 30, 2011 7:39 AM
-
Another option you can try is to get the addresses delimeted by semi-colon ';' and assign in the to, cc or bcc property of send mail task
1. Create an SP in the database that reads a column and assign the value to a string delimeted by semi-colon. A good sample of this kind is at http://databases.aspfaq.com/general/how-do-i-convert-columns-of-values-into-a-single-list.html
2. Add an execute sql task. Call the SP created above and assign the return value to a variable
3. Add a send email taks and sets is To property to the value in the variable asssined in step 2
Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.BH
Wednesday, March 30, 2011 8:21 AM