473,480 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

xp_startmail return code checking

xp_startmail is documented as returning two code: 0 success, 1 failure.
It would be nice to check the return code.

When mail has already been started it returns a 1. This case appears
indistinguishable from a failure to start. (MSFT should have provided
separate return codes for failure-already started, and failure-cannot
start, but they did not.)

Does anyone know how to distinguish these cases. Text is printed
indicating that it has already been started but I don't know how to
programmatically grab this case.

It seems the conventional workaround is not to check the return code at
all (or to start mail once at server startup and never start it again).
Neither is ideal.

Suggestions?

Thanks,
Mark Andersen

Jul 23 '05 #1
5 2033
Hi

You don't say what your client is written in! ADO has an errors collection
that should contain the error, see the topic "Handling Errors and Messages
in ADO" for an overview.

John

"Mark" <ma**********@evare.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
xp_startmail is documented as returning two code: 0 success, 1 failure.
It would be nice to check the return code.

When mail has already been started it returns a 1. This case appears
indistinguishable from a failure to start. (MSFT should have provided
separate return codes for failure-already started, and failure-cannot
start, but they did not.)

Does anyone know how to distinguish these cases. Text is printed
indicating that it has already been started but I don't know how to
programmatically grab this case.

It seems the conventional workaround is not to check the return code at
all (or to start mail once at server startup and never start it again).
Neither is ideal.

Suggestions?

Thanks,
Mark Andersen

Jul 23 '05 #2
Hi

You don't say what your client is written in! ADO has an errors collection
that should contain the error, see the topic "Handling Errors and Messages
in ADO" for an overview.

John

"Mark" <ma**********@evare.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
xp_startmail is documented as returning two code: 0 success, 1 failure.
It would be nice to check the return code.

When mail has already been started it returns a 1. This case appears
indistinguishable from a failure to start. (MSFT should have provided
separate return codes for failure-already started, and failure-cannot
start, but they did not.)

Does anyone know how to distinguish these cases. Text is printed
indicating that it has already been started but I don't know how to
programmatically grab this case.

It seems the conventional workaround is not to check the return code at
all (or to start mail once at server startup and never start it again).
Neither is ideal.

Suggestions?

Thanks,
Mark Andersen

Jul 23 '05 #3
"You don't say what your client is written in!"

No client. This is a SQL Stored Procedure (invoked by a sql job, but
that is irrelevant) in which I wish to call xp_startmail and
distinguish between "failure, already started" and "failure, won't
start".

Did you test it in ADO or are you offering general advice?

Mark

Jul 23 '05 #4
"You don't say what your client is written in!"

No client. This is a SQL Stored Procedure (invoked by a sql job, but
that is irrelevant) in which I wish to call xp_startmail and
distinguish between "failure, already started" and "failure, won't
start".

Did you test it in ADO or are you offering general advice?

Mark

Jul 23 '05 #5
Hi

With ADO/ODBC occasions such as when a status of SQL_SUCCESS_WITH_INFO you
can get the messages and interogate them. The options seem to be assume
that SQLMail is running and not start it every time, or to explicity stop it
first ignoring any errors which it throws up.

You may want to look at: http://www.sqldev.net/xp/xpsmtp.htm as a different
way to send emails.

John
"Mark" <ma**********@evare.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
"You don't say what your client is written in!"

No client. This is a SQL Stored Procedure (invoked by a sql job, but
that is irrelevant) in which I wish to call xp_startmail and
distinguish between "failure, already started" and "failure, won't
start".

Did you test it in ADO or are you offering general advice?

Mark

Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
46543
by: John Ramsden | last post by:
.... when the id 'junk' doesn't exist anywhere in the document, instead of returning 'object'?! I am using Javascript for a drop-down menu, slightly adapted from one by Angus Turnbull (see...
4
1290
by: thechaosengine | last post by:
Hi all, I have a property called GeneralStatus that can return an int between -1 and 3. These values are represented by an enumeration called StatusEnum. My question is, should my property...
0
359
by: Mark | last post by:
xp_startmail is documented as returning two code: 0 success, 1 failure. It would be nice to check the return code. When mail has already been started it returns a 1. This case appears...
2
13229
by: Sara Shoemaker | last post by:
Hi all - I am trying to launch a web browser from within my code for Linux. The problem is that I am getting no failure code back when the browser doesn't launch. (I'm trying to force a failure...
7
1541
by: Michael Kennedy [UB] | last post by:
Hi, I am back with more bug reports from Visual Studio.NET 2003's C++ compiler (unmanaged). Consider the following method: --------------------------------------------- __forceinline bool...
38
1989
by: yomgui | last post by:
hello, is it legal to return inside a for loop or am I obliged to break out of the loop before returning ? thanks yomgui
13
2883
by: cppquester | last post by:
A colleague told me that there is a rule about good stype that a function in C++ should have only one point of return (ie. return statement). Otherwise there might be trouble. I never heard about...
173
7926
by: Marty James | last post by:
Howdy, I was reflecting recently on malloc. Obviously, for tiny allocations like 20 bytes to strcpy a filename or something, there's no point putting in a check on the return value of malloc....
8
5680
by: aarklon | last post by:
Hi all, see:- http://linuxgazette.net/issue51/pramode.html
16
3430
by: Joe Strout | last post by:
Let me preface this by saying that I think I "get" the concept of duck- typing. However, I still want to sprinkle my code with assertions that, for example, my parameters are what they're...
0
7054
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7057
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6756
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5357
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3008
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1310
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
570
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
199
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.