I using PhpMailer using Wamp server and also i enabled this Php extensions ( php_sockets, php_smtp And php_openssl ) i still get error please help.
i using this:
`
require $functions.'PHPMailer/PHPMailerAutoload.php';
$mail = new PHPMailer;
//$mail->SMTPDebug = 3; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.mail.yahoo.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '[email protected]'; // SMTP username
$mail->Password = 'SECRET '; // SMTP password
//$mail->SMTPSecure = 'tls'; // Enable TLS encryption, ssl also accepted
$mail->Port = 465; // TCP port to connect to
$mail->setFrom('[email protected]', 'Mailer');
$mail->addAddress('[email protected]', 'gggg'); // Add a recipient
// Name is optional
/*$mail->addReplyTo('[email protected]', 'Information');
$mail->addCC('[email protected]');
$mail->addBCC('[email protected]');
$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
$mail->addAttachment('/tmp/image.jpg', 'new.jpg');
// Optional name
*/
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body in bold!';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent';
}
?>`
OutPut error is :
Message could not be sent.Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Please help :)
Thanks
You have SMTPSecure = 'tls' with Port = 465; that won't work. Set Port = 587. This is one of the first things covered in the troubleshooting guide that the error links to; It would have been faster for you to read that than ask this question, which is why the link is provided.
Thanks for your fast replaying :)
Still not working bro :(
OutPut error.
Message could not be sent.Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
*NOTE: I DO NOT ENABLED SMTPSecure = 'tls'
So do all the other tests. It's impossible to tell what you're doing as your code formatting is such a mess - please learn how to use it.
i will teat on server, and i will give you replay.
thanks.
same problem in web server bro !!
i just want that way to resolve this error ?
In the latter, I remembered something
From my gmail after i allowed ( Less secure apps ).
It's worked now for me.
Anyway, Thanks for replying .
RESOLVED 馃憤 馃憤 馃憤
Please close
Most helpful comment
So do all the other tests. It's impossible to tell what you're doing as your code formatting is such a mess - please learn how to use it.