---
title: "How to use the email.pl script to send alerts to recipients defined in a managed entity's attribute"
description: "The email.pl script sends alerts to email addresses defined in a managed entity's attribute using userdata \"eMail\" in the rule block. It explains how to pass these email addresses to the email.pl action script for alert delivery."
url: "https://docs.itrsgroup.com/docs/faq/geneos/4588636357917-geneos-how-to-use-the-email-pl-script-to-send-alerts-to-recipients-defined-in-a-managed-entity-s-attribute/index.html"
---
The [email.pl script](https://resources.itrsgroup.com/github-repositories#gateway-email-action-email-scripts-for-gateway-2) can accept email addresses as [userdata](https://docs.itrsgroup.com/docs/geneos/current/processing/monitoring-and-alerts/geneos_rulesactionsalerts_tr/index.html#User_Data) "eMail" in the rule block. This means if you have an email address defined as an attribute on a managed entity, then the following syntax in the rule can be used to pass the email address to the email.pl action script:

```
userdata "eMail" attribute "Your_email_attribute_name"
```

For example, the "\_EMAIL-TO" managed entity attribute contains 2 email addresses.

![Screenshot](https://docscdn.itrsgroup.com/faq/images/geneos/4588636357917-inline-1-mceclip0.png)

Then in the rule block, the email addresses can be passed to the Email\_pl action script like below:

```
userdata "eMail" attribute "_EMAIL-TO"
severity critical
run "Email_pl"
```


