Hi,
I have been using chronoforms V3.0 stable and I can say that its a great product ! Keep it up ! 😀
I am making a tell a friend script and I would like to know how I can use the Dynamic Email option or any other alternative in the chronoforms V3.0 stable in order to send an email to multiple recipients that the user has entered in the form i.e. it won't be using predefined 'to email' but it should send emails to the email addresses entered into the form by the user.
Kind Regards
I have been using chronoforms V3.0 stable and I can say that its a great product ! Keep it up ! 😀
I am making a tell a friend script and I would like to know how I can use the Dynamic Email option or any other alternative in the chronoforms V3.0 stable in order to send an email to multiple recipients that the user has entered in the form i.e. it won't be using predefined 'to email' but it should send emails to the email addresses entered into the form by the user.
Kind Regards
Hi rankwork,
so your form got 2 fields to capture the emails addresses from the user ? what are the 2 fields names ? lets assume they are called : emailfield1 and emailfield2, so simply add 2 dynamic TO fields to your email and at one of them write emailfield1 which is the same as the field name, and at the other write emailfield2
Regards
Max
so your form got 2 fields to capture the emails addresses from the user ? what are the 2 fields names ? lets assume they are called : emailfield1 and emailfield2, so simply add 2 dynamic TO fields to your email and at one of them write emailfield1 which is the same as the field name, and at the other write emailfield2
Regards
Max
Thanks Max, I did that and it works fine.
One problem, I have 3 email fields where the user can enter any of the 3 if he so chooses, meaning he could either enter one two or three email addresses. The thing is if enter one email when test running, it generates the error PHPMAILER_RECIPIENTS_FAILED, if I enter two emails I get SMTP Error! The following recipients failed: but when I enter all 3 fields it works fine.
Is there a possibility of adding an 'OR' somewhere ?
One problem, I have 3 email fields where the user can enter any of the 3 if he so chooses, meaning he could either enter one two or three email addresses. The thing is if enter one email when test running, it generates the error PHPMAILER_RECIPIENTS_FAILED, if I enter two emails I get SMTP Error! The following recipients failed: but when I enter all 3 fields it works fine.
Is there a possibility of adding an 'OR' somewhere ?
Hi rankwork,
try this PHP code in the onsubmit before email box then:
Regards
Max
try this PHP code in the onsubmit before email box then:
$toemails = array();
if(JRequest::getVar('emailfield1')){
$toemails[] = JRequest::getVar('emailfield1');
}
if(JRequest::getVar('emailfield2')){
$toemails[] = JRequest::getVar('emailfield2');
}
if(JRequest::getVar('emailfield3')){
$toemails[] = JRequest::getVar('emailfield3');
}
$emails[0]->to = implode("," , $toemails);
Regards
Max
This did not work. It seems like the script is reading all the dynamic to emails as required hence when one or two are not there then it generates an error as it doesn't read the blank email parameters correctly.
Hey Wait....
Should I change emailfield1 etc to the actual names of my email fields ??
Hey Wait....
Should I change emailfield1 etc to the actual names of my email fields ??
yes you should change that to the emails fields names at your form, I assume you have only 1 email setup, this will work for the first email at the list!
Regards
Max
Regards
Max
This is what I have posted in the on submit code before sending email :
<?
$toemails = array();
if(JRequest::getVar('text_5')){
$toemails[] = JRequest::getVar('text_5');
}
if(JRequest::getVar('text_3')){
$toemails[] = JRequest::getVar('text_3');
}
if(JRequest::getVar('text_8')){
$toemails[] = JRequest::getVar('text_8');
}
$emails[0]->to = implode("," , $toemails);
?>
I still get the same errors. Is there anything else I need to change ?
<?
$toemails = array();
if(JRequest::getVar('text_5')){
$toemails[] = JRequest::getVar('text_5');
}
if(JRequest::getVar('text_3')){
$toemails[] = JRequest::getVar('text_3');
}
if(JRequest::getVar('text_8')){
$toemails[] = JRequest::getVar('text_8');
}
$emails[0]->to = implode("," , $toemails);
?>
I still get the same errors. Is there anything else I need to change ?
try to use <?php instead of <?
how many emails do you have in the "setup emails" tab ?
Regards
Max
how many emails do you have in the "setup emails" tab ?
Regards
Max
can you show me a screenshot of your emails tab and you can hide any private data!
Regards
Max
Regards
Max
This topic is locked and no more replies can be posted.