![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am using xp_sendmail to send emails during execution of package via an ActiveX task. On occasion, our mail server gets full causing the package to hang. |
|
Is it possible to make an ActiveX task timeout like you can an ExecuteProcess Task? I'm looking to be able to cancel the xp_sendmail task and use the fail workflow to execute an alternate method of email. |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Helge, thanks for the reply. By mail server, I actually meant the sql server I am using. I thought this method soley relied on sql server to be set up as a mail client so it shouldn't be touching outlook. |
|
The cdo method is actually the alternate method I am trying to deploy if/when I can fail the xp_sendmail task, although, I haven't actually written the script for this yet. I'm guessing that if the server mail is full, the cdo task will fail as well, so I'm thinking of just using a different server to execute the task if one hangs. |
|
I'm hoping the timeout on the command will successfully cancel the original sqlmail. Here is a sample of the script I use dim cnt, cmd set cnt = CreateObject("ADODB.Connection") set cmd = CreateObject("ADODB.Command") cnt.open "Provider=SQLOLEDB.1;Persist Security Info=False; user id = ; password = ; Initial Catalog=;Data Source=" cmd.ActiveConnection = cnt cmd.CommandText = "exec master..xp_sendmail @recipients = 'me (AT) junk (DOT) com', " _ & "@subject = 'xxxxx', " _ & "@message = 'xxxx' " cmd.Execute |
#5
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |