# Using Python to access Send Email properties

**URL:** https://www.finalbuilder.com/forums/t/using-python-to-access-send-email-properties/1533
**Category:** Discussion
**Created:** [July 23, 2010, 1:37am UTC](https://www.finalbuilder.com/forums/t/using-python-to-access-send-email-properties/1533 "2010-07-23T01:37:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [July 23, 2010, 1:37am UTC](https://www.finalbuilder.com/forums/t/using-python-to-access-send-email-properties/1533/1 "2010-07-23T01:37:44Z")

</div>

I'm trying to write a **BeforeAction** script in Python that needs to modify some of the properties of the **Send Email** Action.

I've been trying to use the help documentation for the Action, but the list of properties there doesn't seem to be Python-friendly (eg. Action.From.Address results in something which isn't a usable string in Python).

I've also been using the Properties panel, and that has helped a lot (eg. Action.FromObject.Address _is_ a string I&nbsp;can use in Python).

However, I&nbsp;want to work with the RecipientsList, and I'm not at all clear on how I&nbsp;can do that. I've tried:

recipients = Action.RecipientsList

and that has given me something that seems to have at least some of the functions mentioned on the **Send Email** Help page for the **IFBAddressList** interface; I&nbsp;can get a Count of the recipients, for example. But when I&nbsp;try:

recipients.Item(i).Address

I&nbsp;get back something, which, again, isn't a string I&nbsp;can use in Python.

I'm also going to want to add to the list of recipients as well as read it, which means I&nbsp;need to be able to pass whatever is expected (a WideString?) to the Add function for the recipients list.

&nbsp;

Am I&nbsp;going about this the wrong way? Is there a good source of info on the properties and how to use them?

Any help would be much appreciated!

&nbsp;

Liam Routt - Krome Studios

---

<div class="post-metadata">

### Author: ![paulsamways](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e8c25b/32.png) [@paulsamways](https://www.finalbuilder.com/forums/u/paulsamways)
#### Post date: [July 23, 2010, 4:28am UTC](https://www.finalbuilder.com/forums/t/using-python-to-access-send-email-properties/1533/2 "2010-07-23T04:28:55Z")

</div>

Hi Liam,

Here is some example python code to access the action’s RecipientsList property:

```python
for i in range(0, Action.RecipientsList.Count):    
  name = Action.RecipientsList.Item(i).Name()    
  address = Action.RecipientsList.Item(i).Address()    
  print name + '' + address

```

```python
Action.RecipientsList.Clear()

```

```python
Action.RecipientsList.Add'Paul', 'paul @ finalbuilder.com')

```

Hope that helps

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [July 23, 2010, 4:54am UTC](https://www.finalbuilder.com/forums/t/using-python-to-access-send-email-properties/1533/3 "2010-07-23T04:54:08Z")

</div>

Works like a charm. Thanks for clearing that up for me.

Am I&nbsp;looking in the right places for documentation of these things (the Help file, mainly)? I'm still a bit confused as to why I&nbsp;seemed to have to use FromObject, rather than From. Or is that simply an alias, and I&nbsp;could have used From.Address() to get the string I&nbsp;was initially expecting?

Liam Routt - Krome Studios
