This topic is locked

Send mail to specific account

4/15/2011 11:27:27 AM
PHPRunner General questions
S
sandrotab author

Hello everyone,

How do I send an e-mail to different accounts by reading the user table and then specificado not hand in your code?
Example:

I tab_utenti the table with the following fields:

id,

user

password

email,

area
and I want to send the mail to all users in that area there is the value '30 '
The following is the code that I currently use but only works in bringing the recipient of the mail code:
//** Send email with modify data ****
$email="destinatario1@gmail.com";

$email="destinatario2@gmail.com";

$from="erpweb1@gmail.com";

$msg="";

$subject="Record modificato in Avvisi";
foreach($values as $field=>$value)

{

if(!IsBinaryType(GetFieldType($field)))

$msg.= $field." : ".$value."\r\n";

}
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from'=>$from));

if(!$ret["mailed"])

echo $ret["message"];
header("Location: document_list.php");

exit();