473,654 Members | 3,096 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp/ado/xp_sendmail/return codes/brain dead

I think I've lost my mind. This worked earlier today. Apparently I broke something but I have no idea what.

I have a stored procedure that builds and sends an email using xp_sendmail. It is called after the user makes a change to a form (it tells the support centre that a change has occurred.)

The last bit of my SP is this:
-- It fails if it has no recipient list
if isnull(@recip, '') = '' set @recip = @supportemail

declare @rc int -- have also tried changing it to bit

exec @rc = master..xp_send mail
@recipients = @supportemail
, @message = @msg
, @subject = @subj
, @no_output = 'False'
, @query = @q
, @width = 200

/*
Return Code Values
0 (success) or 1 (failure)
*/

select @rc
return @rc
If I call it through query analyzer, @rc is 0 and I receive the email.
If I call it through my ASP page (which worked earlier), cint(rs.fields( 0)) is -1 and I do not get the email.

strSQL = "exec pr_EmailNotific ation " & iRequestID
writeline "<P>" & strSQL

set rs = ConnObj.Execute (strSQL)
writeline "<P> Result: " & cint(rs.fields( 0)) '0 (success) or 1 (failure)

(All variables are declared.)

It was working earlier, I had proven it... I thought it was the return @rc line that was doing it and was just keeping in select @rc for debugging. When I was ready to move on, I removed my debug statement, and then it started failing. I've put it back in, but it still fails, so I must have also removed something else, or changed something, or something.

I'm at wits end. It still works perfectly through Query Analyzer. But not ASP.

Any suggestions would be appreciated.

Beverley
Jul 25 '05 #1
1 1408
Okay, I've found my mind.

I forgot I moved a piece of the code in the middle of my SP out to another SP. And the user account being used by the ASP page didn't have access to it, although I did under my own personal ID on Query Analyzer.

All's well, thanks for your time :)

Beverley
"Beverley" <al**********@h otmail.com> wrote in message news:ev******** ******@TK2MSFTN GP15.phx.gbl...
I think I've lost my mind. This worked earlier today. Apparently I broke something but I have no idea what.
Jul 25 '05 #2

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

Similar topics

0
1295
by: Jeff Cochran | last post by:
Does anyone have a code snippet or example on using the xp_sendmail SQL procedure from an ASP page (VBscript)? I have no problem with the stored procedure from a query and I think my problem is getting the parameters passed to the procedure correctly, or just in using stored procedures from ASP. I can execute this SQL from Query Analyzer fine: xp_sendmail "testuser", "Hello World!"
2
23644
by: Jürgen Hetzel | last post by:
Hello! My environment is: Win 2000 Server, MS SQL-Server 2000 (SP2) and MS ExchangeServer 5.5 the two following TransactSQL-codepieces show different results: 1. with attachment
1
6940
by: Ted Theodoropoulos | last post by:
when creating a sp in SQL 2K that uses xp_sendmail i get a message saying: Cannot add rows to sysdepends for the current stored procedure because it depends on the missing object 'xp_sendmail'. The stored procedure will still be created. does this mean that only dependencies involving xp_sendmail will not be stored? the other dependencies appear to be fine. i'm not sure why sql would even bother telling me this info. thoughts?
6
2468
by: Nathan Griffiths | last post by:
I have been testing our SQL Mail setup in SQL Server 2000 (sp3a) and have found that when I attach results as a file, every other character is a control character which causes each real character output on a separate line. I have no idea why this is happenening, I've never seen it before. The code looks like this; EXEC master.dbo.xp_sendmail @recipients = '<email address>', @dbuse = 'TestDB',
6
2482
by: Rolf Kemper | last post by:
Dear All, we are running SQL2000 Sever and make use of the xp_sendmail. For any reason the mail service can run into problems and it looks like that the statemnt below gets not finished. EXEC @Status = master..xp_sendmail @recipients=@TOList, @copy_recipients=@CCList,@subject='the subject goes here',@message=@MailText,@no_output=TRUE
1
1660
by: mike | last post by:
Using the Query Analyzer, I issued the statement "EXEC xp_sendmail 'anyone@hotmail.com, 'Test.'" and received 'email sent' confirmation. But, my email was never received. I used the same statement to send mail to a Yahoo account and it was received. Is there a way to be able to send email using SQL xp_sendmail to a Hotmail account?
1
2999
by: Michael McGarrigle | last post by:
I would like to send the contents of a file using xp_sendmail however I do not want the file contents to be an attachment. I have no problem sending the file as an attachement. Can anybody give me an xp_sendmail example of how to do this. The results of a query can easily appear in the body of the email but all my attempts to include the contents of a file in the body of the email have not worked. TIA
2
3145
by: Eric Timely | last post by:
After a trust with exchange server established the xp_SendMail gives the following error: xp_sendmail: failed with mail error 0x80070005 Prior to the trust everything worked fine. I have tried the following: 1)Checking SQL and SQLAgents accounts all match up with default mail profile.
3
5651
by: Joachim Klassen | last post by:
Hi all, if I accidentally use a TAKEOVER command with BY FORCE clause while primary and standby are in peer state I'll end up with two primary's (at least with FP10 and Windows). Is this works as designed or a bug ? Manuals say that the standby will inform the primary about the takeover but will not wait for acknowledgement, so the primary knows about whats going on. In my eyes primary should either switch to standby or shutdown...
0
8372
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...
1
8475
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
8591
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7304
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...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4149
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2709
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
1
1915
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1592
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.