xp_sendmail - HELP!

  • I desperately need help in using this command, or another means of sending mail.

    We have an administration system designed using web pages (ColdFusion) as opposed to bespoke software using VB and the likes.

    The problem is as follows. We have designed a series of pages whereby people can specify a number of search criteria. this is submitted to SQL via a stored procedure. SQL then crunches the information, extracts a data set, and creates a text file on the server in a format ready for a Word Mailmerge.

    As the operators do not have access to the server where the text files are created, they need to be emailed out to them.

    The only way I've succeeded in doing this is to create a login account in SQL and give it system administrator privileges so that it can execute xp_cmdshell (for the bcp program) and xp_sendmail. The issue is that I'm going to have to code the username and password in plain text onto a web page which is a enormous security risk.

    Is there any way, within a stored procedure, I can invoke these two commands without the user calling the procedure having sysadmin rights?


    ---------------------------------------
    It is by caffeine alone I set my mind in motion.
    It is by the Beans of Java that thoughts acquire speed,
    the hands acquire shaking, the shaking becomes a warning.
    It is by caffeine alone I set my mind in motion.

  • You might consider stuffing the values into a table, then having a job run the stored proc using those values - that way you can run it in the context of a job.

    Andy

  • Doh! Never thought of that, thanks.


    ---------------------------------------
    It is by caffeine alone I set my mind in motion.
    It is by the Beans of Java that thoughts acquire speed,
    the hands acquire shaking, the shaking becomes a warning.
    It is by caffeine alone I set my mind in motion.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply