FPMI Send Email question

I would like to use the fpmi.net.sendEmail(“djtemail","postmaster@thompsonmailing.com”,subject,body,0,recipients) to send emails from an FPMI page. On this page I would have 10 check boxes with certain peoples names in them. When you place a checkmark in the box next to that persons name they are included in the list to receive the email.

If I place a checkmark in all the boxes, when the script is ran it sends the email. However if I unselect one or more boxes the email does not go thru. If I have the console open and I look at the string for the name space recipients, when it works you see the list as:
'name1@domain.com’,‘name2@domain.com’ and so on.

When it does not function and you look at the same string you see:
'name1@donmain.com’,’’,‘name3@domain.com’ and so on. I am not sure how to remove that blank set of quotes.

[code]Here is the code i am using:
name1 = event.source.parent.getComponent(‘Container’).getComponent(‘CheckBox’).name1
name2 = event.source.parent.getComponent(‘Container’).getComponent(‘CheckBox 1’).name1
fulllist =’’
fulllist = name1,name2

body = partid + " - " + partdesc
recipients = [fulllist]
print recipients[/code]

I did try using the + symbol between the name and ended up with a mix of single and double quotes such as:

name1@domain.com’,'name2@domain.com” and so on. the double quotes was mixed in.
Is it because the checkboxes are null when not selected but contain the email string when they are selected as to these single quotes that cause it not to email? What would be the best solution here?

Thanks and have a great weekend

Hi mrtweaver,

If you want to use multiple checkboxes, make sure they are named sequentially (from 1 to 10 in your case) and use the following code:nameList=[] for i in range(1,11): checked=event.source.parent.getComponent('Container').getComponent('CheckBox%s'%i).selected if checked: newName=event.source.parent.getComponent('Container').getComponent('CheckBox%s'%i).name1 nameList.append(newName) print nameListThis code loops through each checkbox (searching for it by name) and ensures it is checked before adding its ‘name1’ field (I’m assuming this is a dynamic property containing the email address) to the Python list.

However, using checkboxes limits you to a fixed number of people and forces you to recode if the people change. What I would suggest is to use a list which you can keep up to date by holding the entries in a database table. You can select multiple people from the list in the usual way, by holding down Shift or Control as you click on the entries. If you do it this way, use the following code:list=event.source.parent.getComponent('List') selected=list.getSelectedValues() nameList=[] for name in selected: nameList.append(name) print nameListLet me know if this helps.