require_once($path_to_root . "/reporting/includes/class.mail.inc");
$company = get_company_prefs();
$mail = new email($company['coy_name'], $company['email']);
- $to = $loc['location_name'] . " <" . $loc['email'] . ">";
$subject = _("Stocks below Re-Order Level at ") . $loc['location_name'];
$msg = "\n";
for ($i = 0; $i < count($st_ids); $i++)
$msg .= $st_ids[$i] . " " . $st_names[$i] . ", " . _("Re-Order Level") . ": " . $st_reorder[$i] . ", " . _("Below") . ": " . $st_num[$i] . "\n";
$msg .= "\n" . _("Please reorder") . "\n\n";
$msg .= $company['coy_name'];
- $mail->to($to);
+ $mail->to($loc['location_name'], $loc['email']);
$mail->subject($subject);
$mail->text($msg);
return $mail->send();