I am kinda new to PHP, so I now have started using Pear where I want to use PHPUnit and other stuff.
I've encountered some errors, I've been looking through the internet to solve it, what I've figured out is that many people had this same problem, but had different sollutions to fix it. I want to sent a message through PHP and get the result to see if it had been successfully sent, I've been looking through the tutorial: http://www.youtube.com/watch?v=UH90nGNXab0
this is the code:
<?php
require_once "Mail.php";
$from = "[email protected]";
$to = "[email protected]";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "ssl://smtp.gmail.com";//"smtp.gmail.com";
$port = "465";//"587";
$username = "picnicrus.ahmadhammad";
$password = "1234432112344321";
$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>");
}
?>
I keep getting this warning: require_once(Mail.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\MailSender\MailSender.php on line 2
following by this fatal error: require_once() [function.require]: Failed opening required 'Mail.php' (include_path='.;C:\wamp\bin\php\php5.3.10\pear') in C:\wamp\www\MailSender\MailSender.php on line 2
So, my conclussion is that:
1) The include path in my php.ini in php isnt correct (include_path = ".;C:\wamp\bin\php\php5.3.10\pear") also my include_path in php.ini in apache is (include_path = ".;C:\wamp\bin\php\php5.3.10\pear") So I wonder if it might be wrong?
2) Or the package isnt correct installed, I have downloaded "Mail" with the following files: mail.php, mime.php, mimePart.php, mock.php, null.php, RFC822.php, sendmail.php, smtp.php, smtpmx.php.
And that directory is in "C:\wamp\bin\php\php5.3.10\pear".
Regards Alexein