require_once "Mail.php";
error_reporting(E_ALL ^ E_STRICT);
$mail_To = $email;
$mail_Subject = "Reservation notification From Tamera Plaza Inn";
$mail_Body = "First Name: $name\n".
"Last Name: $last\n".
"Email: $email \n".
"City: $city \n".
"Zip Code: $zip \n".
"Country: $country \n".
"Contact Number: $cnumber \n".
"Password: $password \n".
"Check In: $arrival\n ".
"Check Out: $departure\n ".
"Number of Adults: $adults\n ".
"Number of child: $child\n ".
"Total nights of stay: $result\n ".
"Room Type: $type\n ".
"Number of rooms: $nroom\n ".
"Payable amount: $payable\n ".
"Confirmation Number: $confirmation\n ";
$host = "localhost";
$username = "";
$password = "";
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($mail_To, $mail_Subject, $mail_Body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
ご覧のとおり、上記のコードはメールの送信に使用されます。それが私のウェブがやろうとしていることですが、私の成功を妨げるものの1つは、以下のエラーです. PEAR であるメール サーバーに接続できないようです。ここで何か不足していますか?
ERROR:
Failed to connect to localhost:25 [SMTP: Failed to connect socket: No connection could be made because the target machine actively refused it. (code: -1, response: )]
ちなみに私はWampserverを使っています