This topic is locked
[SOLVED]

 event after password change

11/7/2011 3:41:10 PM
PHPRunner General questions
V
vettold author

Using the simple email after an event code I am having a problem. I want to send an email to the user after a password change.
The simple email code:
// ** Send simple email ****

$email="test@test.com";

$from="admin@test.com";

$msg="Hello there\nBest regards";

$subject="Sample subject";

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

if(!$ret["mailed"])

echo $ret["message"];
My problem is what the correct substitution would be for the text that is red which i assume would send the email to the user. My table that records the passwords is titled USERS. The fields in that table are username, password, email and customer number.
Great program, learning fast!

C
cgphp 11/7/2011
$rs = CustomQuery("SELECT email FROM USERS WHERE username ='".$_SESSION['UserID']."'");

$record = db_fetch_array($rs);
$email=$record['email'];

$from="admin@test.com";

$msg="Hello there\nBest regards";

$subject="Sample subject";

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

if(!$ret["mailed"])

echo $ret["message"];
V
vettold author 11/7/2011


$rs = CustomQuery("SELECT email FROM USERS WHERE username ='".$_SESSION['UserID']."'");

$record = db_fetch_array($rs);
$email=$record['email'];

$from="admin@test.com";

$msg="Hello there\nBest regards";

$subject="Sample subject";

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

if(!$ret["mailed"])

echo $ret["message"];


V
vettold author 11/7/2011

Thank you it worked perfectly!