This topic is locked
[SOLVED]

 Send Email from Input Field

12/24/2013 12:02:16 PM
ASPRunnerPro General questions
D
dclex author

Hello,
I have an inline add form that contains a field called Email. I am wanting to send an email notifying the email address inputted that they have been added. I am using an Before Record Added event to do this. I am having trouble passing the '".$values["Email"]."' to the $emails. Does anyone see my error?
Thank you!
//** Send email with new data ****
$emails='".$values["Email"]."';

$from="info@mysite.com";

$msg="You have been added to a team!";

$subject="Hi! You've Been Added!";
$ret=runner_mail(array('to' => $emails, 'subject' => $subject, 'body' => $msg, 'from'=>$from));

if(!$ret["mailed"])

echo $ret["message"];
//** Check if specific record exists ****

global $conn;

$strSQLExists = "select * from memusers where Email='".$values["Email"]."'";

$rsExists = db_query($strSQLExists,$conn);

$data=db_fetch_array($rsExists);

if($data)

{

return true;

}

else

{

//** Insert a record into another table ****

$strSQLInsert = "insert into memusers(Email, Username, AccessType, Password, Beginpay, Endpay, Paypal) values ('".$values["Email"]."','".$values["Name"]."','".$values["AccessType"]."', 'UKcg75','2008-1-1', '2008-1-1', '1')";

CustomQuery($strSQLInsert);

return true;

}
return true;

mperry622 12/24/2013



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


is the above line need to be email not emails?
never mind. I missed your variable.
Are you setting the session variable in after records have been processed?

D
dclex author 12/24/2013

No, I figured it out...
$emails="select * from memusers where Email='".$values["Email"]."'";
Thank you and happy holidays!