Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xp_sendmail error

Status
Not open for further replies.

cmmrfrds

Programmer
Joined
Feb 13, 2000
Messages
4,690
Location
US
I am using xp_sendmail for the first time after getting Sql mail setup on my server. The mail works okay for alerts. I am using the xp_sendmail in a stored procedure.

The error is;
ODBC error 2812 (42000) Could not find stored procedure 'mail'.

Any idea of what could be going wrong.

Thank you,
Jerry
 
This is the SP, created in the master database.

alter Procedure sp_TestMail
As
declare @msgText varchar(255)
SELECT @msgText = 'This is my mail test'

exec xp_sendmail 'greatwhite', @msgText, 'mail test'

return
 
xp_sendmail is treating your subject as a Query and trying to execute the SP named 'mail'. Name the XP parameters as follows.

exec xp_sendmail
@recipients = 'greatwhite',
@message = @msgText,
@subject = 'mail test'
Terry L. Broadbent
Programming and Computing Resources
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top