Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP SQL Anywhere, on-demand edition 1.0 SP 6 » Task syntax

SendUserEmail task

Sends an email to a cloud user.

Syntax 1 (SQL)
CALL DBCloud.SendUserEmail ( user_list=user_list, subject=subject, body=body [, optional-parameters ] )
Syntax 2 (Cloud Command utility)
dbcloudcmd run SendUserEmail user_list subject body [ optional-parameters ]
  • user_list

    A list of recipient cloud users. Accepts a search query that identifies users. The search query can be a list of object names or IDs separated by semicolons (;), or a full search. (Required)

  • subject

    The subject of the email. (Required)

  • body

    The body of the email. (Required)

  • attachment_file

    The file name and path of a file to attach from the host file system. The default is NULL.

  • content_type

    The MIME Content-Type of email body. The default is 'text/plain'.

  • timeout_in_sec

    The timeout in seconds. The default is 60.

  • character_set

    The character set of the supplied subject and body. The default is db_property('charset').

  • host

    The host where the email should be sent from. Accepts a search query that identifies one host, for example a host name or ID. The default is DBCloud.F_CurrentHost().

Required privileges



Your cloud must have email enabled and configured for this task to succeed. You can enable or change the email server by using the AlterCloud task.

Email must be configured for the user(s) specified in the user_list parameter. Users can be configured with the AlterUser task.

To send emails to one or more specified email addresses, use the SendDistributionEmail task.


The following task sends an email to the cloud user fred:

dbcloudcmd run SendUserEmail user_list=fred subject="Test subject" body="This is the body of the email"

The following task sends an email with an HTML body and an attachment to multiple cloud users:

dbcloudcmd run SendUserEmail user_list="fred;wilma;barney" subject="More complex example" body="
     <h1>The heading of the email body</h1><p>A paragraph within the email body.</p>" attachment_file="c:\myfile.txt" content_type="text/html"