Sorry to be a brat again...I don't mean to be...but my mind ain't with me and I'm banging my head on the keyboard (theoritcally speaking), because I'm trying to get my script to SEND a mail to notify of an update to just 1 user from the db...
what I mean is:
If someone has their approval status as N for not approved, and I change it to Y, is approved via a form to update my database, I want it to send to the user I've updated...
So this is a snippet of my script...the update part:
$query = "UPDATE $table2 SET approved = 'Y' WHERE
approved = 'N' LIMIT 1";
$result = mysql_query($query) or problem('Can not approve affiliate.' . mysql_error());
return $result;
//note from moonbrat: $approve is reading the FORM NAME//
if($approve) {
$to = $obj->email;
$message="Hello $obj->username;
You have been approved approved by $settings[admin_name] to be an affiliate with $settings[site_name]. Your username and password are shown below. DO NOT lose this email as you may need to refer to it if you need to update your information at: $settings[site_url]
Affiliate Details:
Name: $obj->username;
Password: $obj->pw;
Regards,
$settings[email_name].
";
$subject = "Affiliation Approved!\n";
$headers = "From: $settings[email_name] <$settings[admin_email]>\n";
$headers .= "Reply-To: $settings[email_name] <$settings[admin_email]>\n";
mail($to,$subject,$message,$headers);
}
I don't get any errors, it works perfect, BUT the email WONT send when updated, can anyone suggest what I can do to get it to send? I know my php reads the mail() functions because when I want something to send to me on someone signing up, it works no problems....because I've used it elsewhere in my script just not with update...
Sorry, my mind's just not with me and I've been at this all night...the damn thing won't do what I want it to do!
-Moonbrat