I try to send a mail from php via my local smtp server (using PEAR mail). I have a message of success but the message is not send. I think the problem is in my server.. Even when i test with telenet i get no error.. Here is an extract off my php code :
require_once "Mail.php";
$from = "<hotline.cfao@test.com>";
$to = "<pessokho@gmail.com>";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "10.68.153.137";
$port = "25";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
When i call this script i got "Message successfully sent!". When check in my mail box i got nothing.