Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2003
    Location
    california
    Posts
    21

    Question Unanswered: send email from TSQL

    Hi Folks,

    How can I send emails from within the TSQL code?

    I have a stored procedure within which I need to test for a condition and send emial alerts on failure of that condition.

    Any help will be greatly appreciated.

    Thanks,
    Astha

  2. #2
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621

    Re: send email from TSQL

    Check xp_sendmail in BOL.

  3. #3
    Join Date
    Jan 2003
    Location
    california
    Posts
    21
    Dont we need to do some kind of configuration before using xp_sendmail SP? Is there any SMTP configurations involved or I can use the SP directly in my code?

    Thanks,
    Astha

  4. #4
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    Originally posted by astha_raj
    Dont we need to do some kind of configuration before using xp_sendmail SP? Is there any SMTP configurations involved or I can use the SP directly in my code?

    Thanks,
    Astha
    Of course you have to configure a mail profile.
    BOL: SQL Mail must run using a mail profile created in the same domain account that is used to start an instance of Microsoft® SQL Server™.

Posting Permissions

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