napravio sam forgot pasword skriptu lijepo ako netko zaboravi sifru da moze novu sifru imati, i sve radi dobro al ne mogu primiti email nikako, dobijem ovakav error
Warning: mail(): Failed to connect to mailserver at "smtp.gmail.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\ja\forgotpassword.php on line 86
ubacio sam i php mailer kod i folder i sve napravio kako treba:
ovo dole je example.php a ne znam dal vam treba forgotpassword.php kod
<?php
require ‘phpmailer/PHPMailerAutoload.php’;
$mail = new PHPMailer;
//$mail->SMTPDebug = 3; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = ‘smtp.gmail.com’; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = ‘[email protected]’; // SMTP username
$mail->Password = ‘madanebi’; // SMTP password
$mail->SMTPSecure = ‘ssl’; // Enable TLS encryption, ssl
also accepted
$mail->Port = 465; // TCP port to connect to
$mail->setFrom(‘[email protected]’, ‘Mailer’);
$mail->addAddress(‘[email protected]’, ‘Joe User’); // Add a recipient
$mail->addAddress(‘[email protected]’); // 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’;
}
?>