---
title: "Powermail with multiple receivers based on checkboxes"
url: "https://www.typo3.net/d/112473-powermail-with-multiple-receivers-based-on-checkboxes"
source: "typo3.net"
tags: ["Extensions","Entwicklung","English","Frage"]
created: "2012-10-16"
last_reply: "2012-10-16"
replies: 0
solved: false
page: 1
pages: 1
lang: "en"
---

# Powermail with multiple receivers based on checkboxes

Extensions › Entwicklung · 0 Antworten · gestartet 2012-10-16

## Eröffnungsbeitrag

**tomitzel** · 2012-10-16 · [Beitrag #1](https://www.typo3.net/d/112473-powermail-with-multiple-receivers-based-on-checkboxes/1)

Hello,

I have a form with a checkbox, to each checkbox the value is an email address. I want to send the form to all email addresses that were checked before.
I am using Powermail 2.0 and for that I've used the method with userFunc & typocript.

I've added in the field Receiver email:

```html
{f:cObject(typoscriptObjectPath:'lib.powermail_receiver')}
```

The typoscript:

```typoscript
includeLibs.manipulatePowermailReceiver = fileadmin/templates/ext/powermail/manipulateReceiver.php
lib.powermail_receiver = USER
lib.powermail_receiver.userFunc = user_manipulatePowermailReceiver->getEmail
```

The script:

```php
class user_manipulatePowermailReceiver {

    public function getEmail($content = '', $conf = array()) {
        $variables = t3lib_div::_GP('tx_powermail_pi1');
        $receiversArr = $variables['field']['1'];

        foreach ($receiversArr as $rec) {
            if (!empty($rec) && $rec != '') {
                $receiversArrFiltered[] = $rec;
            }
        }
        
        $receivers = implode(',', $receiversArrFiltered);
        
        return $receivers;
    }

}
```

My problem is that if there is checked more than one email address, the form is not send and in FE I only see
Error: The mail wasn't sent.

I've noticed during debuging that if I have email1@test.com,email2@test.com coming out of the script it doesn;t work, but if the same values are inserted in the plugin settings at Receiver email then it works and it sends to both email address.

Any suggestions?

---

Quelle: „Powermail with multiple receivers based on checkboxes“, typo3.net, https://www.typo3.net/d/112473-powermail-with-multiple-receivers-based-on-checkboxes
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
