i am sending a mail using php mail file.but i am getting error.this is my code and error
Failed to connect to ssl://smtp.gmail.com:465 [SMTP: Failed to connect socket: Unable to find the socket transport "ssl"
- did you forget to enable it when you configured PHP?
(code: -1, response: )]
<?php
@require_once "Mail.php";
$from = 'email';
$to = 'email';
1. List item
$subject = 'Hi!';
$headers = array(
'To' => $to,
'Subject' => $subject,
'from' => $from
);
$smtp = @Mail::factory('smtp', array(
'host' => 'ssl://smtp.gmail.com',
'port' => '465',
'auth' => true,
'username' => 'email',
'password' => 'password'
));
$mail = @$smtp->send($to, $headers);
if (@PEAR::isError($mail)) {
echo('<p>' . $mail->getMessage() . '</p>');
} else {
echo('<p>Message successfully sent!</p>');
}
?>
this all error
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\Net\SMTP.php on line 491
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\Net\SMTP.php on line 265
Strict Standards: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\pear\Net\SMTP.php on line 267