I have been battleing with XP_SMTP_SendMail and I am winning to some extent. The last piece of the jigsaw is being able to show in the message/body the relevant data pulled from the database. I am having trouble concatenating the data together. This is part of what I am using: DECLARE @rc int DECLARE @body VARCHAR(1024)
It's probably failing because you're trying to concatenate a string 'Action' to an integer @ID. Try casting or converting your @ID to a varchar (or char if it's fixed length). Instead of doing this from your mail procedure try just doing this in query analyzer until you get to the point where @body can be output as a string, then you know you have the bugs worked out.