当初はmail()関数でメールを送信していましたが、常にスパムフォルダに引っ掛かっていたので、PHP PEARを使ってSMTPで送信したいのですが、エラーが発生します。
Functions.phpには、次のようなメール機能があります。
function send_mail($from,$to,$subject,$body)
{
// Setting up the SMTP setting
$smtp_info["host"] = "smtp1.servage.net";
$smtp_info["port"] = "25";
$smtp_info["auth"] = true;
$smtp_info["username"] = "xxx@auto-sal.es";
$smtp_info["password"] = "xxx";
// Creating the PEAR mail object :
$mail_obj =& Mail::factory("smtp", $smtp_info);
$headers = '';
$headers .= "From: $from\n";
$headers .= "Reply-to: $from\n";
$headers .= "Return-Path: $from\n";
$headers .= "Message-ID: <" . md5(uniqid(time())) . "@" . $_SERVER['SERVER_NAME'] . ">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Date: " . date('r', time()) . "\n";
$mail_sent = $mail_obj->send($to,$subject,$body,$headers);
if (PEAR::isError($mail_sent)) { print($mail_sent->getMessage());}
しかし、次のエラーが発生します。
致命的なエラー:クラス「メール」が17行目の/mounted-storage/hoxxx/xxx01/xx/auto-sal.es/functions.phpに見つかりません
ただし、私のホストにはこれらのモジュールがインストールされていますhttps://www.servage.net/wiki/List_of_PEAR_modules
誰かアドバイスしてもらえますか?