私は2つのページを持っています:
自動化.php チェックメール.php
自動化.phpは次のとおりです。
<?php include 'scripts/checkemail.php'; ?>
と:
<?php
if(!function_exists("sendemail"))
{
function sendemail($email_to,$email_from,$email_subject,$email_body,$email_replyto,$cc='')
{
if(filter_var($email_to, FILTER_VALIDATE_EMAIL))
{
require_once "/usr/local/lib/php/Mail.php";
$from = $email_from;
$to = $email_to;
$subject = $email_subject;
$body = $email_body;
$host = "mail.domain.co.uk";
$username = "sending@domain.co.uk";
$password = "*********";
$headers = array ('From' => $from,
'To' => $to,
'Cc' => $cc,
'Subject' => $subject,
'Content-type' => 'text/html');
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$rec = $to.', '.$cc;
$mail = $smtp->send($rec, $headers, $body);
}
}
}
?>
次に、checkemail.phpでこの関数を呼び出しています。
sendemail("techsupport@domain.co.uk","Support <no-reply@domain.co.uk>","Contact Not Found",$contact_not_found_email,"no-reply@domain.co.uk");
しかし、私はこのエラーが発生しています:
Fatal error: Call to undefined function sendemail() in /home/integra/public_html/automate/scripts/checkemail.php on line 180