【发布时间】:2011-10-21 16:33:09
【问题描述】:
这是我的代码
$from = "Whatever<whatever@gmail.com>";
$to = "whatever<whatever@hotmail.com>";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "ssl://smtp.gmail.com";
$port = "465";
$username = "whatever@gmail.com";
$password = "whatever";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
?>
我得到的错误是: 警告:require_once(PEAR.php) [function.require-once]:无法打开流:第 46 行的 /home/pedurc5m/php/Mail.php 中没有这样的文件或目录
致命错误:require_once() [function.require]:无法在第 46 行的 /home/pedurc5m/php/Mail.php 中打开所需的 'PEAR.php' (include_path='/home/pedurc5m/php/') 我的共享主机网络服务器说
您的 PHP 扩展和应用程序的位置
路径:/home/pedurc5m/php
为什么会出错? 我是 PHP 新手,谢谢大家的帮助!
【问题讨论】: