This topic is locked

Email Problem

2/5/2008 4:37:59 PM
PHPRunner General questions
L
lawfour author

Hi
I am using the below before record updated code but, $email = $values["EMail"]; does not work. Can someone help..
I am using before edit to send an email to the person who edited a message board, everything works except this code, $email = $values["EMail"]; .
$email = $values["EMail"];

$message="";

$subject="Your question on www.lawfour.com has been answered";
// Additional headers

$headers = 'From: Lawfour.com Message Board <lawfour@comcast.net>' . "\r\n" . 'Cc: Lawfour.com Message Board <lawfour@comcast.net>' ;
foreach($values as $field=>$value)

$message.= $field." : ".$value."\r\n";
mail($email, $subject, $message, $headers );
return true;
// return true if you like to proceed with editing this record

// return false otherwise

S
smcgo4 2/5/2008

I had a similar problem. alshine suggested:
$email = "".$data["Email"]."";
and it worked like a charm.

L
lawfour author 2/6/2008

Hi Thanks,
I seen your post and tried it but received a $Data error, think I got the error because the script is using $values, maybe if I changed all the $values to $data that may work,
Thanks

L

I had a similar problem. alshine suggested:

$email = "".$data["Email"]."";
and it worked like a charm.

S
smcgo4 2/6/2008

Ooops, yes you would need to change data to values

Hi Thanks,

I seen your post and tried it but received a $Data error, think I got the error because the script is using $values, maybe if I changed all the $values to $data that may work,
Thanks

L