RE: using a variable for a @TO parameter in xp_stmp_sendmail

From: Nigel Rivett (NigelRivett_at_discussions.microsoft.com)
Date: 06/26/04

  • Next message: Nigel Rivett: "RE: Changing 100 table object owner names at once"
    Date: Sat, 26 Jun 2004 15:38:01 -0700
    
    

       declare @TO nvarchar(100)
       set @TO = N'yyy@abc.ab.ca'

       declare @rc int
       exec @rc = master.dbo.xp_smtp_sendmail
            @FROM = N'xxx@abc.ab.ca',
            @FROM_NAME = N'Tenrox Time*** Approval',
            @TO = @TO,
            @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'

    "schmidtk" wrote:

    > 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: Nigel Rivett: "RE: Changing 100 table object owner names at once"