.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

SSIS Send mail task

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :Sql Server
In the Send mail task, I want to use a variable in the To:(recipients of the email message) of the task. So I declared Emailrecipients variable as a string. In property expressions editor of the Send mail task: I wrote the follow expression: Property: ToLine Expression: @[User::Emailrecipients] In the send mail task editor, in the To line, what should I write? Thanks.  sqldev

View Complete Post

More Related Resource Links

SSIS 2005 - Send Mail Task - signature appended to email is garbled - unicode problem?

Hi, I'm pretty new to SSIS so go easy on me. I have a Send Mail Task to notify if a file cannot be imported - the mailbody is created on the previous step by a VB.NET script task to include the name of the file and the path it's been archived to. The problem I'm having is that while the body of the email I've created is displaying fine, our company's Exchange server appends a signature to all emails, and this is coming up as undisplayable characters, presumably due to some kind of unicode encoding problem. I've tried casting the email body in an expression to DT_STR (doesn't work as DT_STR "cannot be converted to a supported type" which seems a bit odd but never mind), DT_WSTR (garbled signature), DT_TEXT/DT_NTEXT (strange error on this one - "Attempted to read or write protected memory") none of those ideas worked, and I'm a bit stumped now. Can anyone help? I'm using SSIS 2005 with SP3

send records as weblinks through send mail task in SSIS?

Hi All, i have a table with two columns and two records as follows. TypeOfReport                       Links InvalidRecords                http://ReportInvalid MissingRecords               http://ReportMissing --------------------- I have a package with execute sql task selecting * from the table above, full result set selected and an object variable created, it works good. but now when i connect it with send mail task, i wanna send email like Subject : Reports On InvalidRecords and MissingRecords MessageText : Links for the Reports : http://ReportInvalid                                                     : http://ReportMissing Can somebone help me with it. NOTE : i tried creating user and object variable but its good if i have only one record in table. i tried creating 2 user and 2 object variables as well but didnt work. Thanks

SSIS Send Mail Task - Failure Sending Mail

Dear all, I have switched off the firewall settings on my system and as suggested im entering the minimal information and data to send the mail. but still the Mail Task is failing.. plz suggest.

SSIS Send Mail Task - Failure Sending Mail

Hi Everyone, Hopefully someone out there will have an idea as this is driving me nuts. I've setup a task to email on success/failure and keep receiving the following message when executed: Progress: The SendMail task is initiated. - 0 percent complete[Send Mail Task] Error: An error occurred with the following error message: "Failure sending mail.". Progress: The SendMail task is completed. - 100 percent completeTask Send Mail Task failed When I configure Outlook Express on the same machine with the same settings it works. On the SMTP Connection Manager I have left the default name, tested with both an IP address and Server Name, and no authentication or SSL. On the Send Mail Task, it uses the above connection. The To: , From: , Subject  fields are populated. Message SourceType is DirectInput, MessageSource is Test, Priority is Normal and no attachments or expressions etc. Nothing useful is logged in the Event Viewer even with full logging turned on. Any suggestions appreciated, Thanks.

Send multiple parameters SSIS execute process task



We are using Execute Process Task in SSIS package to execute a batch file to house keep the generated flat files which are older than a week from the archive folder.

The same batch file is used to delete the some temp files generated in the process.

As the Archive folder and temp folder paths are configurable, we are trying to pass the folder paths as parameters to batch file.

I used Expressions tab of Execute process Task Editor to map the variable to Arguments property. This is working fine. but I need to pass one more variable as an Argument.

Can some one help me how to achieve this. Thanks in advance.


Sreekanth ABS



How to generate an excel and send it as email attachment in SSIS 2005 Script Task Component?


I am using a "Script Task" component. I am trying with following three simple steps:

1) Obtain the excel content in HTML

Dim reportInHtml As String = GenerateHTMLReport()

2) Generate an excel with below code:

Dim message As MailMessage

message = New MailMessage(fromAddress, toAddress, subject, String.Empty)

Using memoryStream As MemoryStream = New MemoryStream()

        Dim contentAsBytes As Byte() = Encoding.UTF8.GetBytes(reportInHtml)
        memoryStream.Write(contentAsBytes, 0, contentAsBytes.Length)
        memoryStream.Seek(0, SeekOrigin.Begin)

        Dim contentType As ContentType = New ContentType()
        contentType.MediaType = "application/ms-excel"
        contentType.Name = "Excel_Report.xls"

        Dim excelAttachment

Send Mail Task Error



i am using send mail task in a package which is giving me the error below.

Error: 2010-10-03 18:01:42.96

   Code: 0xC002F304

   Source: Notify Success Send Mail Task

   Description: An error occurred with the following error message: "Error in p\

rocessing. The server response was: 4.7.0 Timeout waiting for client input".

End Error"

SSIS Expression to send email with dataset on the Mail Subject line.



I have a task - I need to email total number of products sold on the subject line of the mail task.

I have Execute SQL task process like select count(*) from tablename. Then I need to Mail the result set like "Total products sold September 2010 : 15000" on teh subject line.

I created a variable bit i dont know how to assign it on the subject line of the Send Mail Task.

I would really appreciate if you can guide me.

Thanks for your help.


executing query in send mail task



I need to execute a select statement in a send mail task in SSIS. I can send regular emails using this task, but is is possible to send a select statement through? I have tried xp_sendmail, but we are not allowed to turn this feature on, and  I have tried reporting services, but the service is not installed. Lots of road blocks... LOL


If this is not possible, please recommend an alternative...

Any help would be appreciated


Dave SQL Developer

Event Handler (send mail task) firing multiple times for each dataflow error - How can I stop the da


I've set up an OnError event handler for my package which sends an email containing the name of the file that fails import through my dataflow task. The problem is the dataflow experiences three errors (one for each task it is attempting to complete) which in turn causes three duplicate emails to be sent.

I'd prefer to stop the dataflow task completely rather than allow it to try to complete the remaining tasks after the first error. Is this possible? Alternately, how can I set up my event handler to only send one email regardless of the number of dataflow errors that occur?

Thanks in advance!

Send Mail Task Delivery Notification


I am using a send mail task in my ssis package. Is there a way to get a delivery notification. Thanks.

Toolbox: Create Graphs, Send E-Mail, Spell-Check, and More


Turn boring data into stunning graphs, create, parse, send, and receive mail messages from code, and more.

Scott Mitchell

MSDN Magazine August 2007

I cannot send mail using gmail smtp server


 Here is my code

Dim message As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage()
        message.To.Add("from textbox field")
        message.Subject = "Testing"
        message.From = New System.Net.Mail.MailAddress("sender email ")
        message.Body = "Just Testing"

        Dim smtp As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient()

        Dim client As SmtpClient = New SmtpClient()
        smtp.Credentials = New System.Net.NetworkCredential("username", "password")
        smtp.Port = 25
        smtp.Host = "smtp.gmail.com"
        smtp.EnableSsl = True
        smtp.DeliveryMethod = SmtpDeliveryMethod.Network
        lblmsg.Text = "Your Email has send"


create Scheduled Task that auto send mails


hello every one

i bought a hosting plan that allows me to send about 500email/per hour

but my client wish to send about 2000 or 3000 email at a time

is there a way to split them and 500 email per a time automaticly without the need of reloging again every hour

my hosting plan doesn't allow me to create a sql jop or send mails via Sql Server.

any bright ideas ?

How to send mail to individual users.



  I need to send the same mail to multiple users separately. I dont want to use comma delimeted "To Address" . Because other users can able to see the recipients.

   Each recipient should not know about the other recipients. 

   How will I achieve this one without for loop ?


E-Mail Alerts for users on Task List


Is there any way to send e-mail alerts to a specific user wihtout assigning them the task or having them subscribe to the list.

It's a Task List on WSS 3 on Win2k3 Enterprise'


send mail don't run

Dim strFrom = "NewsLetter@Kinesiologiaviva.it"             Dim strTo As String = String.Empty             Try                 Dim conn As SqlConnection                 Dim cmd As SqlCommand                 Dim cmdstring As String = "SELECT * FROM vw_MLDestinatari Where [NomeCont]='" & TxtGruppo.Text & "'"                 conn = New SqlConnection(SqlDataSource1.ConnectionString)                 cmd = New SqlCommand(cmdstring, conn)                 conn.Open()                 Dim myReader As SqlDataReader                 myReader = cmd.ExecuteReader(Data.CommandBehavior.CloseConnection)                 While myReader.Read                     strTo &= myReader("Mail") & "; "                 End While            &n
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend