you can use the code below to search for emails stored in $mail_to_mail
// Check for record
$check_sql1 = ‘SELECT DISTINCT email’
. ’ FROM sec_users’
. ’ INNER JOIN bpv_pok_opgeleverd ON sec_users.st_id = bpv_pok_opgeleverd.bpv_beg_school’
. " WHERE bpv_pok_opgeleverd.loc_id = ‘" . [usr_loc_id] . "’ AND bpv_pok_opgeleverd.bpv_afgerond = ‘4’";
sc_select(rs, $check_sql1);
$arr = array($rs);
//verzamelen van de mailadressen
{field_total} = 0;
if (false == {rs}) // Error while accessing database
{
sc_error_message(‘Error while accessing database.’);
}
else
{
while(!$rs->EOF)
{
foreach({rs} as $value)
$mail_to_mail[] = $value[0];
$mail_to_mail = implode(’; ', $mail_to_mail);
}
$rs->Close();
}
you can use the code below to send the mail
[usr_login] is the user who send the mail
/**
// Email parameters
$mail_smtp_server = [smtp_server_brixx]; // SMTP server name or IP address
$mail_smtp_user = [smtp_user_brixx]; // SMTP user name
$mail_smtp_pass = [smtp_pass_brixx]; // SMTP password
$mail_from = [smtp_from_brixx]; // From email
$mail_to = [usr_login]; // To email
$mail_message = $bericht;
$mail_subject = 'BRIXX BPV Mededeling: ’ . {subject} . ‘’; // Message body
$mail_format = ‘H’; // Message format: (T)ext or (H)tml
$mail_copies = $mail_to_mail; // List of the emails that will recieve the message
$mail_tp_copies = ‘BCC’; // Type copies: BCC (Hiden copies) or CCC (Regular copies)
$mail_port = ‘2525’; // Server port
$mail_tp_connection = ‘N’; // Connection security (S) or (N)
- if you let the use the mailadres outside scriptcase i have no answer to this