This topic is locked

my email event do not work

2/29/2008 1:02:30 AM
PHPRunner General questions
A
alan@sfvcc.com author

I am a newbe.
I am trying to send a message on a beforeAdd event.
I have the following code:
[codebox]//** Send email with new data ****
$email="alan@sfvcc.com";

$message="";

$subject="New data record";
foreach($values as $field=>$value)

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

// return false otherwise

[/codebox]
I am not sure what I am missing here but no message ever gets sent.
I also would like to send a message to the poster. Any pointers would be appreciated.

J
Jane 2/29/2008

Hi,
make sure your PHP is configured to send emails.

More info here:

http://www.php.net/mail
To send email to person who posted the record use this code:

...

$email = $values["EmailField"];

...



where EmailField si your actual field name on the add page.

A
alan@sfvcc.com author 3/2/2008

Hi,

make sure your PHP is configured to send emails.

More info here:

http://www.php.net/mail
To send email to person who posted the record use this code:
where EmailField si your actual field name on the add page.


Yes I have other PHP forms that do send email.

A
alan@sfvcc.com author 3/2/2008

It started working, thanks for the tip on sending to the poster. That works very well.