Home > Archive > SQL Anywhere database > October 2005 > send email using sql at message parameter









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author send email using sql at message parameter
Luis Telles

2005-10-27, 7:41 am

Hi friends, i am using the xp_startsmtp for send mail but i need to send a
query in the message parameter, for example:

CALL "dbo"."xp_startsmtp"("smtp_sender" =
'hpalomino3@adisof.com',"smtp_server" = 'www.qqq.com.pe',
"smtp_port" = 25,"timeout" = 60);

CALL xp_sendmail( recipient='hpalomino
@adisof.com',
subject='Backup',
cc_recipient = 'ltelles@adisof.com',
"message"= select name_customer from customer );

At SQLServer it`s possible.

Thanks

Luis Telles


Greg Fenton

2005-10-27, 7:41 am

How about :


BEGIN
DECLARE @name VARCHAR(1000);

>
> CALL "dbo"."xp_startsmtp"("smtp_sender" =
> 'hpalomino3@adisof.com',"smtp_server" = 'www.qqq.com.pe',
> "smtp_port" = 25,"timeout" = 60);
>


SET @name = (select name_customer from customer);

> CALL xp_sendmail( recipient='hpalomino
@adisof.com',
> subject='Backup',
> cc_recipient = 'ltelles@adisof.com',
> "message"= @name);


END;


greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
Breck Carter [TeamSybase]

2005-10-27, 7:41 am

Or he could use SELECT LIST ( customer_name ).

On 26 Oct 2005 17:39:47 -0700, Greg Fenton
<greg. fenton_NOSPAM_@ianyw
here.com> wrote:

>How about :
>
>
>BEGIN
> DECLARE @name VARCHAR(1000);
>
>
> SET @name = (select name_customer from customer);
>
>
>END;
>
>
>greg.fenton


--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/A...7/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com