ssis send mail task: Error: An error occurred with

2019-08-09 20:05发布

问题:

SSIS package in question runs a series of stored procedures and fills 13 different excel files with results and sends those excel files to 13 different users in attachments. Package run stops with the message in the title of this question, sometime right in the middle of sending or for example today, on the 4th user. The files get created because I can see them in their directories so only the send mail task is failing. When I go back to visual studio and execute each send task manually, send task works fine even though sometime it still gives me the error yet, still sends the right file to the right person but not thru SSIS package run in SQL server... I tried to delay SMTP processes thinking that might be in the way (to 660000 miliseconds) but did not help. Has this happened to anybody?.. Thanks for all your answers in advance.

Here is the full message for a task that sent the e-mail with attachment regardless the error when task was manually executed...

[Send Mail Task] Error: An error occurred with the following error message: "The operation has timed out.".
Progress: The SendMail task is completed. - 100 percent complete
Task Send Mail Task for Inventory Reports 038 failed
Finished, 12:03:03 PM, Elapsed time: 00:00:00.655

回答1:

I think I figured it out why this was happening. In case somebody / anybody is interested, here is what I think has happened. I was trying to expand the timeout period thru a script task, playing with Threading.Thread.Sleep value but I neglected to do the same in my SMTP connection properties. When I changed the timeout value in properties for SMTP connection, error messages stopped coming :)

I wish I could post a picture to show you where exactly that property is located but my reputation failed me!.. :( (less than 10 points yet)

I am in the process of completing all of my changes then I will post again with final result hoping that will resolve all of my problems.

Thanks to all who showed interest.