The forum will be unavailable for maintenance at some point from Friday, April 13 at 19:00 EDT until Sunday, April 15 at 23:59 EDT. Downtime will be minimized but the exact timing is unknown.

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: 9%

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: 32%

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: 839 times

last updated: 21 Nov '13, 05:24