using a variable for a @TO parameter in xp_stmp_sendmail

From: schmidtk (schmidtk_at_discussions.microsoft.com)
Date: 06/17/04

  • Next message: BGS: "Using Stored Procedure returned fields in another Stored Proc or Query"
    Date: Thu, 17 Jun 2004 10:40:01 -0700
    
    

    I am using the following to send mail, but instead of
    @TO = N'yyy@abc.ab.ca'
    I want to specify a variable from my procedure:
    @TO = N@emailaddress
    where @emailaddress is populated during the procedure

       declare @rc int
       exec @rc = master.dbo.xp_smtp_sendmail
            @FROM = N'xxx@abc.ab.ca',
            @FROM_NAME = N'Tenrox Time*** Approval',
            @TO = N'yyy@abc.ab.ca',
            @subject = N'Please approve overtime for the following staff',
            @messagefile= N'C:\testing.txt',
            @type = N'text/plain',
            @attachments= N'C:\HowToApprove.txt',
            @server = N'sssssss.abc.ab.ca'


  • Next message: BGS: "Using Stored Procedure returned fields in another Stored Proc or Query"