Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003

    Question Unanswered: Trigger store proc from email.

    I have a mainframe that can send out emails.
    I would like to send one to our SQL server and execute a stored proc when the server receives the email.

    Is that possible? If so, please let me know what I need to do to get this working.

    Thank you,


  2. #2
    Join Date
    Jul 2003
    San Antonio, TX


    Unfortunately, here you will have to use SQLMail on your server (at least at this point I don't know how else to receive mail). Have a scheduled task running every...15 minutes, for example. It will contain a wrapper that you will have to create for xp_findnextmsg and xp_readmail (check sp_processmail in master). Upon completion of each xp_readmail you will need to execute your procedure. Of course, in addition to all this you will need your error handling implemented so that you do not attempt to use any of the xp_xxxmail stuff if your SQLMail is down. There was a discussion on on how to ensure that your SQLMail is running. Also, back in 6.5 time I used to have SQLMail startup option to be set to OFF, and do xp_startmail...xp_read/send...xp_stopmail for every message that I needed to read/write. Kind of awkward, but it never failed.
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts