My code :
require_once('C:\xampp\htdocs\jobs\protected\vendor\Mail-1.2.0\Mail.php');
$from = "s@gmail.com";
$to = "r@yahoo.com";
$subject = "Activation";
$body = " Hi";
$host = "ssl://smtp.gmail.com";
$username = "acc@gmail.com";
$password = "password";
$port = "465";
$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)) {
$res['stat'] = false;
$res['ket'] = $mail->getMessage();
} else {
$res['stat'] = true;
$res['ket'] = true;
}
print_r($res);
It need enabling php_openssl.dll
is there any some way without activated it in php.ini?
or maybe activated by code in php..?
*when i'm activated php_openssl.dll in php.ini it's work's, and i don't want to activated it directly and then restart the service..