I'm trying to set up authentication emails for my website. I don't need anything fancy or secure, but I'm having massive troubles trying to get this to work.
Here is my PHP
function emailconfirmation($temppass, $emailaddress) {
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'tls';
$mail->Host = 'smtp.gmail.com';
$mail->Port = 587;
$mail->Username = 'myEmail@gmail.com';
$mail->Password = 'myGmailPassword';
$mail->SetFrom('myEmail@gmail.com');
$mail->AddAddress($emailaddress);
$mail->Subject = 'Test';
$mail->Body = 'test authentication key: ' . $temppass;
if(!$mail->send()) {
return 'Error: ' . $mail->ErrorInfo;
} else {
return true;
}
}
And here is the error it keeps spitting out
2013-09-14 22:43:13 CLIENT -> SERVER: EHLO www.mydomain.com 2013-09-14 22:43:13 CLIENT -> SERVER: STARTTLS
Warning: stream_socket_enable_crypto(): this stream does not support SSL/crypto in C:\wamp\bin\php\includes\PHPMailer-master\class.smtp.php on line 274
2013-09-14 22:43:13 CLIENT -> SERVER: QUIT 2013-09-14 22:43:13 SMTP ERROR: QUIT command failed: SMTP connect() failed.
Any help that you guys can provide would be great. FYI, I've allowed the port 587 through my firewall, and the email I'm sending to is not the same as the one I'm sending from. Thanks!
EDIT: Seriously, nobody? This is really getting on my nerves