all groups > sql server mseq > june 2004 >
You're in the

sql server mseq

group:

using a variable for a @TO parameter in xp_stmp_sendmail


using a variable for a @TO parameter in xp_stmp_sendmail schmidtk
6/17/2004 10:40:01 AM
sql server mseq:
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 Timesheet 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',
RE: using a variable for a @TO parameter in xp_stmp_sendmail Nigel Rivett
6/26/2004 3:38:01 PM
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 Timesheet 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'

[quoted text, click to view]
AddThis Social Bookmark Button