I want to create a trigger which executes the stored procedure
xp_sendmail or sp_send_dbmail. which one is correct.
By creating a trigger i need to send an email from the database and i am using sql server 2005.
'For this i used xp_sendmail but it is asking for parameter @user.
Kindly provide the detailed information how can i overcome these problems in sql server 2005 to send an email to a gmail or yahoo account using my trigger.
As you're on SQL 2005 you should use sp_send_dbmail. If you read the article Brimstedt linked to, you'll see that xp_sendmail is deprecated. It's only there for backwards compatibility.
answered Feb 23 '10 at 04:48 AM
Here is a helpful link: http://lmgtfy.com/?q=xp_sendmail
From what i can see in documentation, there is no @user parameter. There is @set_user, but it is not mandatory.
The docs further says that xp-sendmail is great for use in triggers, so i guess you're on the right track: http://msdn.microsoft.com/en-us/library/ms189505.aspx
Perhaps posting the exact error message you get can help us help you.
answered Feb 23 '10 at 04:02 AM