Assistance needed urgently!
I use a Sybase Database with SQL Anywhere 9 and need to send the SQL query result as the body of the e-mail from within SQL. Here's what I have thusfar:
================================================== =====
bEGIN
SET NOCOUNT ON
select distinct
CLient from Client;
IF @@ROWCOUNT > 0
BEGIN
DECLARE @body VARCHAR(1024)
SET @body = 'Client Names ' +
CONVERT(VARCHAR, GETDATE()) +
CHAR(13) + CHAR(10) +
CONVERT(VARCHAR, @@ROWCOUNT)
xp_startsmtp( smtp_sender = 'support@test.co.za', smtp_server = '196.166.8.110' , smtp_port = 25 )
EXEC master..xp_sendmail
recipients='test@test.co.za',
"message" = @body,
subject = 'SomeThing123'
END
END
================================================== =====
Thanks in advance. :confused: