# do-send-email

The <do-send-email> action causes an email notification to be sent to the specified server. Optional credentials for authentication to the SMTP server are provided by the id attribute and <arg-password>. The type attribute identifies if the email message contains plain text or HTML data. The various email addresses, subject and message are provided within <arg-string> elements and corresponding tag name attributes.

> Tag Name | Description
> --- | ---
> to | Adds the address to the list of email recipients. Multiple instances are allowed. May contain a comma separated list of recipients.
> cc | Adds the address to the list of CC email recipients. Multiple instances are allowed. May contain a comma separated list of recipients.
> bcc | Adds the address to the list of BCC email recipients. Multiple instances are allowed. May contain a comma separated list of recipients.
> from | Specifies the address to be used as the originating email address.
> reply-to | Specifies the address to be used as the email message reply address.
> subject | Specifies the email subject.
> message | Specifies the content of the email message.
> encoding | Specifies the character encoding to use for the email message.
> custom-smtp-header | Specifies a custom SMTP header to add to the email message.

If any type of error occurs as part of sending the email, the error string will be available to the enclosing policy in the local variable named error.do-send-email. Otherwise that local variable will be unavailable.

### Example

>     <do-send-email id="user" server="smtp.company.com" type="text">
>       <arg-password>
>         <token-named-password name="email-server"/>
>       </arg-password>
>       <arg-string name="to">
>         <token-text>to_user1@company.com</token-text>
>       </arg-string>
>       <arg-string name="to">
>         <token-text>to_user2@company.com</token-text>
>       </arg-string>
>       <arg-string name="cc">
>         <token-text>cc_user@company.com</token-text>
>       </arg-string>
>       <arg-string name="bcc">
>         <token-text>bcc_user@company.com</token-text>
>       </arg-string>
>       <arg-string name="from">
>         <token-text>from_user@company.com</token-text>
>       </arg-string>
>       <arg-string name="subject">
>         <token-text>This is the email subject</token-text>
>       </arg-string>
>       <arg-string name="message">
>         <token-text>This is the email body</token-text>
>       </arg-string>
>       <arg-string name="custom-smtp-header">
>         <token-text>X-Priority: 1(Highest)</token-text>
>       </arg-string>
>     </do-send-email>

## 1. Allowed Content

> arg-password
>   password argument
> arg-string
>   string argument

## 2. Attributes

> Attribute | Value(s) | Default Value
> --- | --- | ---
> disabled | true | false true if this element is disabled | false
> id | CDATA user account on SMTP server supports variable expansion | #IMPLIED
> notrace | true | false true if this element should not be traced during execution of policy | false
> password | CDATA password for user on SMTP server deprecated - use <arg-password> with <token-named-password> instead | #IMPLIED
> server | CDATA DNS name or IP address of SMTP server supports variable expansion | #REQUIRED
> type | text | html identifies if email message contains plain text or HTML data | text

## 3. Content Rule

> ( arg-password ? , arg-string * )

## 4. Parent Elements

> actions
>   actions that are performed by a <rule>
> arg-actions
>   actions argument

Top Elements || All Elements || Tree