473,606 Members | 2,218 Online
Bytes | Software Development & Data Engineering Community
+ 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
indistinguishab le 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
programmaticall y 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 2048
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**********@e vare.com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.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
indistinguishab le 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
programmaticall y 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**********@e vare.com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.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
indistinguishab le 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
programmaticall y 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_WIT H_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**********@e vare.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.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
46556
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 http://javascript.internet.com and http://gusnz.cjb.net, not that this is probably relevant but it deserves a plug ;-), on Internet Explorer v6.0.2800.1106. I need this feature of getElementById(), or an equivalent one (using sound and standard...
4
1296
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 definition return a int (the underlying type of the enum) or should I return the enum itself.
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 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...
2
13239
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 case so I can test the alert dialog, so I am trying to launch a browser that I know doesn't exist on my machine). I am checking the return value from the call to system(), and am checking the WEXITSTATUS() of the return code, and both evaluate...
7
1550
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 CReplayBase::ReplayFillBuffer() { CFile* pFile = NULL;
38
2017
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
2900
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 it and doubt it. Anybody heard of it? What would be the advantage? Regards, Marc Example:
173
8049
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. OTOH, if you're allocating a gigabyte for a large array, this might fail, so you should definitely check for a NULL return.
8
5702
by: aarklon | last post by:
Hi all, see:- http://linuxgazette.net/issue51/pramode.html
16
3447
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 supposed to be -- too often I mistakenly pass in something I didn't intend, and when that happens, I want the code to fail as early as possible, so I have the shortest possible path to track down the real bug. Also, a sufficiently clever IDE could use...
0
8015
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7951
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8439
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8094
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6770
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5465
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3977
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2448
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 we have to send another system
0
1296
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.