I have the following code:
The file that's being "included" in that code is this:
When I end up running the page with the include statement, it keep getting a "Fatal error: Call to undefined function: send_mail() in c:\hosting\webhost4life\member\maxtex\maximizetech\dev\vwp\includes\infoReqSend.php on line 37" error.
If I copy and paste the contents of the file being included into the original file it works fine.
Arruuu?
KizMar
------------
Code:
<?php
// Receiving POST from infoReq.php form
// Pull variables and send e-mail.
$FName = $_POST['txtFName'];
$LName = $_POST['txtLName'];
// Use method for sending mail
include './includes/sendMail.php';
// Set up mail variables
$to = 'test@test.com';
$subject = 'Information Request Form';
// Add needed headers
$headers = "From: test@test.com\n";
$headers .= "MIME-Version: 1.0\n";
// Build message body
$body = 'Message to ' . $FName . ' ' . $LName;
// Send user to this page to confirm mail has been sent
// location path starts at root web folder
$e = 'index.php';
send_mail($to,$subject,$body,$headers,$e);
?>
The file that's being "included" in that code is this:
Code:
<?php
// Send mail function
// $e = destination once mail is succesfully sent.
function send_mail($to,$subject,$body,$headers,$e) {
$message =& Mail::factory('mail');
$message->send($to,$subject,$body,$headers);
// Send message
// mail($to,$subject,$body);
// Send user to destination URL
header('Location: ' . $e);
}
?>
When I end up running the page with the include statement, it keep getting a "Fatal error: Call to undefined function: send_mail() in c:\hosting\webhost4life\member\maxtex\maximizetech\dev\vwp\includes\infoReqSend.php on line 37" error.
If I copy and paste the contents of the file being included into the original file it works fine.
Arruuu?
KizMar
------------