I write code send mail using PHPMailer
include 'class.phpmailer.php';
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'ssl';
$mail->SMTPDebug = 1;
$mail->Host = 'smtp.gmail.com';
$mail->Port = 465;
$mail->Username = 'example1@gmail.com';
$mail->Password = 'password';
$mail->SetFrom('example2@gmail.com', 'Admin');
$mail->AddReplyTo('example@yahoo.com', 'Name');
$mail->AddAddress('xample3@gmail.com');
$mail->Subject = 'Active email';
$mail->MsgHTML('Click the link to active');
$mail->Send();
When I use browser it can send mail, but in command prompt,
php path_to_file
it is not working,the error is:
SMTP -> ERROR: Failed to connect to server: Unable to find the socket transport ssl"....