dbTalk Databases Forums  

xpsendmail task hangs...need to make it timeout

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss xpsendmail task hangs...need to make it timeout in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Edgar
 
Posts: n/a

Default xpsendmail task hangs...need to make it timeout - 05-10-2005 , 12:05 AM






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.


Thanks

Edgar


Reply With Quote
  #2  
Old   
Helge C. Rutz
 
Posts: n/a

Default Re: xpsendmail task hangs...need to make it timeout - 05-10-2005 , 07:01 PM






Hi Edgar,

"Edgar" <passport3432 (AT) sbcglobal (DOT) net> schrieb im Newsbeitrag
news:1115701501.797868.220210 (AT) f14g2000cwb (DOT) googlegroups.com...
Quote:
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.
this is a general problem with the mail tools interacting with outlook, but
not able to react on messageboxes etc.
Even stopmail could fail here.
You had to kill the send process which is not a good solution.

Quote:
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.
there is no way to timeout the task. Maybe you can timeout the command with
the commandtimeout property set to a low value where you execute
xp_sendmail.
But how would this leave SQL Mail behind.

I prefer to send mail directly with cdo, to avoid any outlook interaction.
Do you know this article?
http://support.microsoft.com/default...b;en-us;312839

Helge




Reply With Quote
  #3  
Old   
Edgar
 
Posts: n/a

Default Re: xpsendmail task hangs...need to make it timeout - 05-10-2005 , 09:32 PM



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

cnt.close
Set cnt = nothing

Edgar


Reply With Quote
  #4  
Old   
Helge C. Rutz
 
Posts: n/a

Default Re: xpsendmail task hangs...need to make it timeout - 05-11-2005 , 01:26 AM



Hi Edgar,

"Edgar" <passport3432 (AT) sbcglobal (DOT) net> schrieb im Newsbeitrag
news:1115778745.225008.65870 (AT) g14g2000cwa (DOT) googlegroups.com...
Quote:
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.
all mail features of the SQL Server relies on MAPI which require the local
installation of Outlook.
And the integration of outlook can cause a lot of trouble.
e.g. there can be security warnings because of the latest security patches,
asking if an external process is allowed to send mails through outlook -
where nobody is able to press ok on the hidden dialog ;-)
You should read the SQL Mail section in the online help.

Quote:
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 not sure what you mean by mail server is full.
Do you want to send the mail through a relay server or directly to the
recipient server?

Quote:
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
You also have to set the CommandTimeout property here, because the default
is AFAIK 0 which means wait unlimited.
But I never tested this with an xp call - let me know what happens.

Helge




Reply With Quote
  #5  
Old   
Edgar
 
Posts: n/a

Default Re: xpsendmail task hangs...need to make it timeout - 05-12-2005 , 10:44 AM



I want to go directly to the recip. server. Hopefully the timeout will
work and all will be well. Thanks for your help


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.