mysql_query("INSERT INTO tickets
(subject, name, email, cat, phone, status, ID, priority, ip, timestamp)
VALUES
('" . addslashes($subject) . "', '" . addslashes($name) . "'
, '$email', '$cat', '". addslashes($phone) . "', 'open', $id,
$pri, '$ip', FROM_UNIXTIME('$gmtime') + 0)");
$config[ticket_msg] = str_replace("%email", $email, $config[ticket_msg]);
if (($interval >= $min_interval) and $config[ticket_response]) {
mail($email, $config[ticket_subj],
$remove_tag . stripslashes($config[ticket_msg]) . "\n\n" . $cat[signature], "From: $cat[email]\n");
}
this is within a function that has $email as one of its parameters. It inserts the correct email into the database. It replaces %email with the correct address. It mails it to the wrong address, which is always an email from a previously opened support ticket (from table tickets) in the database.
notice how $email should not change at all between the functions mysql_query(), str_replace(), and mail(). but it DOES. and that's why i think it's a sendmail problem.