Hello there,
I have a dropdown form which is working perfect with the code below. I send it as a BCC. And is working fine. BUT I want to send to multiple (40 to 50) emails if one option is selected eg.
'Salzburg' => [email]'email@yahoo.com[/email],email2@yahoo.com',
I get the following error:
[email]PHPMAILER_RECIPIENTS_FAILEDemail@yahoo.com[/email],email2@yahoo.com
How can you do it? Or is there a solution to get the emails out of database?
Thanks for your help.
Mostlyseven
PS: I have bought the book "ChronoForms 1.3 for Joomla! Site Cookbook" it is great!
I have a dropdown form which is working perfect with the code below. I send it as a BCC. And is working fine. BUT I want to send to multiple (40 to 50) emails if one option is selected eg.
'Salzburg' => [email]'email@yahoo.com[/email],email2@yahoo.com',
I get the following error:
[email]PHPMAILER_RECIPIENTS_FAILEDemail@yahoo.com[/email],email2@yahoo.com
How can you do it? Or is there a solution to get the emails out of database?
Thanks for your help.
Mostlyseven
PS: I have bought the book "ChronoForms 1.3 for Joomla! Site Cookbook" it is great!
<?php
$select_7 = JRequest::getString('select_7', 'admin', 'post');
$emails = array (
'Salzburg' => 'email@yahoo.com',
'Wien' => 'email@google.com',
'admin' => 'admin@example.com'
);
$email_to_use = $emails[$select_7];
JRequest::setVar('email_to_use', $email_to_use);
?>
Hi,
try to set them as an array instead of a comma separated string:
Cheers,
Max
try to set them as an array instead of a comma separated string:
'Salzburg' => array('email@yahoo.com', 'email2@mmm.com'),
Cheers,
Max
Hi mostlyseven ,
It may also be that 40-50 emails is more than the mailer function can handle in one go. You might be better off hand-coding a mailer using a foreach loop to will send individual emails to each adressee.
Bob
It may also be that 40-50 emails is more than the mailer function can handle in one go. You might be better off hand-coding a mailer using a foreach loop to will send individual emails to each adressee.
Bob
Hi all,
If I use an array I get following:
SMTP-Fehler! Die folgenden Empfänger sind nicht korrekt:
Warning: trim() expects parameter 1 to be string, array given in \libraries\joomla\mail\helper.php on line 39
In the BCC it says: Array
The code is:
Thanks for your help!
Mostlyseven
If I use an array I get following:
SMTP-Fehler! Die folgenden Empfänger sind nicht korrekt:
Warning: trim() expects parameter 1 to be string, array given in \libraries\joomla\mail\helper.php on line 39
In the BCC it says: Array
The code is:
<?php
$select_7 = JRequest::getString('select_7', 'admin', 'post');
$emails = array (
'Salzburg' => array('email1@yahoo.com','email2@yahoo.com'),
'Wien' =>'email3@yahoo.com',
'admin' =>'admin@example.com'
);
$email_to_use = $emails[$select_7];
JRequest::setVar('email_to_use', $email_to_use);
?>
Thanks for your help!
Mostlyseven
I set the SITE configuration => server => mailing - to PHP funktion and then it worked with following code:
Following question remains: since there will be more and more emails to send to, is there a way to get the emails out of a table? What would the code be?
Thank you so much for your help.
Sabine
<?php
$select_7 = JRequest::getString('select_7', 'admin', 'post');
$emails = array (
'Salzburg' =>'email1@yahoo.com,email2@yahoo.com,email3@yahoo.com,email4@yahoo.com,email5@yahoo.com',
'Wien' =>'webmaster@example.com',
'admin' =>'admin@example.com'
);
$email_to_use = $emails[$select_7];
JRequest::setVar('email_to_use', $email_to_use);
?>
Following question remains: since there will be more and more emails to send to, is there a way to get the emails out of a table? What would the code be?
Thank you so much for your help.
Sabine
This topic is locked and no more replies can be posted.