RE: using a variable for a @TO parameter in xp_stmp_sendmail
From: Nigel Rivett (NigelRivett_at_discussions.microsoft.com)
Date: 06/26/04
- Previous message: j: "Headers and Footers from SQL"
- In reply to: schmidtk: "using a variable for a @TO parameter in xp_stmp_sendmail"
- Messages sorted by: [ date ] [ thread ]
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'
- Previous message: j: "Headers and Footers from SQL"
- In reply to: schmidtk: "using a variable for a @TO parameter in xp_stmp_sendmail"
- Messages sorted by: [ date ] [ thread ]