like "call to undefined function" when i attempt to use email() function in it. who can tell me why
wo, another question on emailing in PHP
Moderator: General Moderators
-
johnsonzhang
- Forum Newbie
- Posts: 3
- Joined: Sun Apr 06, 2003 5:33 am
- Contact:
wo, another question on emailing in PHP
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
like "call to undefined function" when i attempt to use email() function in it. who can tell me why
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
There is a mail() function but not an email() function built into PHP - perhaps this is the problem.
Mac
Mac
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" ;
}
}
?>- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
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?Oromian wrote:hehe, unless you do something like this:
Mac