Forums

a list of e-mail addresses (Could not instantiate mail funct

amorino 17 Dec, 2010
Hello,
I tried to use the point 31 in the faqs : How can I safely show a list of e-mail addresses?

I created a select element :

 <select class="cf_inputbox validate-selection" id="select_13" size="1" title="Vous n'avez pas choisis le pays de destination" name="select_13" onChange="affiche(this.value)">
    <option value="" selected>Pays</option>
      <option value="france">France</option>
<option value="maroc">Maroc</option>
<option value="tunisie">Tunisie</option>
    </select>


And in the On Submit code - before sending email I put :

<?php
$emails_2 = array('france'=>'aaa@aaa.fr;bbb@bbb.fr;ccc@ccc.fr', 'maroc'=>'ddd@ddd.fr;eee@eee.fr;fff@fff.com', 'tunisie'=>'ggg@ggg.fr;  hhh@hhh.fr');
$MyForm =& CFChronoForm::getInstance('PlanifierRDV2');
$MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
$MyFormEmails->setEmailData(1, 'to', $emails_2[$_POST['select_13']]);
?> 


When submitted I get : Could not instantiate mail function
Any help please?
Best regards
Amorino
amorino 18 Dec, 2010
Sometimes I get strangely after submit a message like:

You are not allowed too access this URL

Best regards
Amorino
GreyHead 18 Dec, 2010
Hi amorino,

Please try turning the Check Token to OFF in the form General tab.

Bob
amorino 18 Dec, 2010
Hello,
a very very strange thing is happening whith this code!

The one in the center (maroc) is working but not the other two !

Is this meaning something for you?

Any help please?
Best regards
Amorino
amorino 20 Dec, 2010
Chronup please🙂
amorino 21 Dec, 2010
Hello
I'm really blocked here

Any help Bob please😉
GreyHead 21 Dec, 2010
Hi amorino,

The code looks OK to me. You have semi-colon (;) separated lists where I think I'd have used commas (,) and there is a tiny difference in spacing. I don't see any good reason when 'maroc. would woroka and the other two not work.

The "Could not instantiate mail function" is usually a sign that there is no mailer set up on your site - but the Joomla! mailer errors are not always very accurate.

Please turn debug on in the form General Tab, then submit the form and post the debug - including the 'dummy emails' results here.

Bob
This topic is locked and no more replies can be posted.