Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Xp_sendmail error

Posted on 2008-10-30
1
718 Views
Last Modified: 2008-11-03
Hello,

I am trying to use xp_sendmail to send out an email. Upon executing the procedure that contains the sendmail code i receive an error that says "xp_sendmail: Procedure expects parameter @user, which was not supplied." However after attempting to define the @user parameter an error stating "xp_sendmail: Invalid parameter '@user'" I believe the MS page tells me to leave the @user parameter off. How can i successfully and correctly send email from with a stored procedure using ms sql server 2005? Sample code attached
EXEC master.dbo.xp_sendmail 
    @recipients=N'emailaddress@anywhere.anything',
    @message=N'some text.'

Open in new window

0
Comment
Question by:bnrtech
1 Comment
 
LVL 6

Accepted Solution

by:
bcsql earned 500 total points
ID: 22845132
xp_sendmail is the old sql mail from sql 2000. Database mail is for sql 2005 setup database mail and us sp_send_dbmail. The error you are getting usually refers to the SQL mail is not setup or running correctly you can try xp_stopmail and xp_startmail. The outlook profile has to be setup for sqlmail also. The error is not very good as there is no @user in xp_sendmail.


http://msdn.microsoft.com/en-us/library/ms175887(SQL.90).aspx

0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Query 2 63
Not selecting duplicate data 6 60
Updating statistics with error notification email in SQL server 4 110
Query to return total 6 22
If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question