我正在尝试通过 php 编码发送电子邮件,但出现以下错误
Warning: require_once(Mail.php): failed to open stream: No such file or directory in /home/madeingu/public_html/sendemail.php on line 5
Fatal error: require_once(): Failed opening required 'Mail.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/madeingu/public_html/sendemail.php on line 5
请检查我的代码也许你会知道我做错了什么
<?php
require_once "Mail.php";
$name="lisa";
$mail_from="xx@xx.com";
$subject="testing";
$message="this is test email";
$header="me";
$to = "Shop <xx@xx.com>";
$from = "xx@xx.com";
$host = "mail.xxxxxxx.com";
$username = "xx@xx.com";
$password = "password";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $message);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
//echo("<p>Message successfully sent!</p>");
echo'<table width="800" border="0" align="center" >
<td>';
echo "We've recived your contact information, we will get back soon!";
echo'</td>
</table>';
}
?>
请检查上面的代码对我来说似乎没问题,因为我在网上检查了大部分代码。
但可能与 php 配置或 php.ini 更改有关。
无论如何请让我知道。
谢谢