Using xp_sendmail in ASP?

J

Jeff Cochran

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!"

I've tried this in ASP:

strSQL = "EXEC xp_sendmail 'testuser', 'Hello World!'"
conn.Execute strSQL

But I don't get any error, no mail gets sent and it hangs my test
server. I'm using the SA account and password for the OLEDB
connection. Can't tell if the server is hanging in SQL or ASP, but it
locks up hard, no keyboard/mouse functions even work.

What the heck am I screwing up here...?

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,828
Latest member
LauraCastr

Latest Threads

Top