Hi there,
I’m using the latest version of the Scriptcase. Now i’m trying to finish my project but i have a problem;
I’m using mysql on my computer. Now just think there is 2 tables;
- periodic_maintenance
- employer_staff
There is a form for employer_staff, so i insert 3 person to here. This table has this fields;
- Name
- Sirname
- Email address
There is another form for periodic_maintenance and it has a fiedl that i can select employer_staff (i can select multi) as name and surname.
I want to send emails to selected employer_staffs. So i’m using this codes in the “onAfterInsert” side;
$sending= "";
sc_select(my_data, "select id_employer_staff, email from employer_staff where '{employer_staff}' = id_employer_staff");
if ({my_data} === false)
{
echo "Access error. Message =". {my_data_erro};
} else {
while (!{my_data}->EOF)
{
$sending= $sending . {my_data}->fields[1] . ";";
{my_data}->MoveNext();
}
{my_data}->Close();
}
$mail_smtp_server = 'mail.google.com';
$mail_smtp_user = 'onderxyilmaz@gmail.com';
$mail_smtp_pass = 'my_gmail_password';
$mail_from = 'onderxyilmaz@gmail.com';
$mail_to = 'onderxyilmaz@gmail.com';
$mail_subject = 'Who will get this email';
$mail_message = 'Mail gönderilecek kişiler = ' . $sending;
$mail_format = 'H';
$mail_copies = '';
$mail_tp_copies = '';
$mail_port = '465';
$mail_tp_connection = 'S';
sc_mail_send($mail_smtp_server,
$mail_smtp_user,
$mail_smtp_pass,
$mail_from,
$mail_to,
$mail_subject,
$mail_message,
$mail_format,
$mail_copies,
$mail_tp_copies,
$mail_port,
$mail_tp_connection);
It send the email but only the first employer_staff, not all selected. How can i solve this problem?
Best regards.