0
votes

I used the drupal example email module (email_example) found here: http://drupal.org/project/examples

I'd like to email multiple recipients and according to http://api.drupal.org/api/drupal/includes!mail.inc/function/drupal_mail/6:

$to: The e-mail address or addresses where the message will be sent to. The formatting of this string must comply with RFC 2822. Some examples are: [email protected] [email protected], [email protected] User User , Another User

HOWEVER. When I try to modify $to in function email_example_mail_send($form_values) {

I am not able to add multiple addresses.

either

 $to = "[email protected]";
 $to = $form_values['email1'];

work,

but

$to = "[email protected]", "[email protected]";

or

$to = $form_values['email1'], $form_values['email2'] ;

do not.

1

1 Answers

2
votes

Your strings aren't properly formatted. What you need is something like this:

$to = $form_values['email1'] . ', ' . $form_values['email2'];

That will place the comma separated email addresses into $to.