Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

set content='select * from shipper';
CALL xp_startsmtp( smtp_sender = '', smtp_server='', smtp_port='25',
timeout=240, smtp_auth_username='mfkpie8', smtp_auth_password='password');
CALL xp_sendmail( recipient='',
      subject='ssssssss',"message"=content,query='select * from shipper');
call xp_stopmail();

question: But did not receive my email, just received ‘select * from shipper',Don't have any data

asked 21 Nov '13, 04:42

mfkpie8's gravatar image

accept rate: 12%

edited 21 Nov '13, 04:42

This is expected behaviour - confine the docs on the query parameter:

This LONG VARCHAR is provided for Transact-SQL compatibility. It is not used by SQL Anywhere. The default is NULL.

So I guess you will have to either

  • output your query result to a file (via the UNLOAD statement) and attach that file to your mail or
  • output your query result to a variable and add that variable's contents to the "message" parameter.

The cited doc page shows some samples on the usage.

permanent link

answered 21 Nov '13, 05:06

Volker%20Barth's gravatar image

Volker Barth
accept rate: 34%

edited 21 Nov '13, 05:07

Can you help me to modify under my SQL

(21 Nov '13, 05:24) mfkpie8

Try This:

CALL xp_sendmail( recipient='Sales Group', subject='New Pricing', include_file = 'C:\DOCS\PRICES.DOC' );

permanent link

answered 21 Nov '13, 05:17

Adiel's gravatar image

accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 21 Nov '13, 04:42

question was seen: 2,330 times

last updated: 21 Nov '13, 05:24