Hi there,

I am not sure if this is a bug or what but I have a working version of form_mail on my server. I have even gotten to the point of customizing the "to" field (AKA the recipient) by posting....

$form .= form_textfield("Branch", "to", "", 60, 128, "Enter Your Branch Email Address Here");

Still, I would like to use a drop down box so that people can select a branch from the list but the actuall value is an email address. So I searched through the common.inc and found the function that renders a select box and came up with this....

Arry for the values
$Branches = array("jejiv@yahoo.com"=>"Yahoo", "jimj@pathinsight.com"=>"Pathinsight");

$form .= form_select("Concierge Branch", "to", "", $Branches, "Please enter the branch to send this to.",
"", "FALSE", "FALSE");

When i submit this, the drop down is generated but I get an error when actully useing the for.
It says....
warning: mail() expects parameter 1 to be string, array given in /srv/www/htdocs/drupal/modules/user.module on line 366.

I also checked the source of the HTML form that is generated and I see that...

YahooPathinsight

has a name="edit[to][]" when the other form elements do not.

Could that be the problem? Am I doing somthing wrong? Or is it the code?

Comments

ricabrantes’s picture

Version: 4.5.x-1.x-dev » 4.6.x-1.x-dev
Status: Active » Closed (fixed)