Page 1 of 1
wo, another question on emailing in PHP
Posted: Fri Apr 18, 2003 11:51 am
by johnsonzhang
I've tried it out last time. but the server replied to me an error message
like "call to undefined function" when i attempt to use email() function in it. who can tell me why

Posted: Fri Apr 18, 2003 12:13 pm
by twigletmac
There is a
mail() function but not an email() function built into PHP - perhaps this is the problem.
Mac
Posted: Fri Apr 18, 2003 7:38 pm
by m3mn0n
hehe, unless you do something like this:
Code: Select all
<?php
function email ($to, $subject, $messege, $headers){
if(mail($to, $subject, $message,$headers)) {
echo "Mail Sent";
} else {
echo "Mail Not Sent" ;
}
}
?>

Posted: Sat Apr 19, 2003 5:25 am
by twigletmac
Oromian wrote:hehe, unless you do something like this:
Well that's not actually a function
built in to PHP - it's a user-defined function. Since the error received is
call to undefined function it could be that there has just been a spelling mistake - if there already was a defined function called email() then the error wouldn't happen would it?
Mac