This topic is locked

Error e-mail - insert a new record

11/13/2007 6:45:12 AM
PHPRunner General questions
M
mauro author

Ive this error when i try to inser a new record
mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing
in php.ini
; For Win32 only.

SMTP = 192.168.1.9

smtp_port = 25

; For Win32 only.

sendmail_from = my-email@my-doamin.com
in file richiesta_events.php
<?php
function AfterAdd()

{

// ** Send simple email ****
$email="my-email@my-doamin.com";

$message="My Text Message";

$subject="My Subject message";

mail($email, $subject, $message);

//** Redirect to another page ****

header("Location: ok.htm");

exit();
} // function AfterAdd
?>

Alexey admin 11/13/2007

Hi,
looks like you inspecting wrong file.
Check the sendmail_from option value in C:\Windows\php.ini file.

Or use phpinfo() PHP function to find out where your php.ini is located.
Also you can add custom From field to the email.

I.e.

mail($email, $subject, $message,"From: my-email@my-doamin.com\r\n");