kito2
www.masteria.net
Hello, Im looking for a system for Modern AAC (PHP) where you put your account e-mail adress plus character name or account, and the server will mail you the account and a new password.
---------------
I will update first post with the solution:
---------------
Ok, since Lucaz coulnd't made the system yet, I will keep trying to guide the topic to do what I need:
PHP - How to login e-mail and password? Just found some configurations at php.ini (from google)
But where to put password?
PHP - This is the code to send an e-mail, easy programable to get e-mail from account and generate a new account and send a new password*.
PHP - Generating a random password on SHA1:
The problem here is to decript the password, because we need to update account's password at database, but also we need to send an e-mail to the requester with the new password.
------------------------------
Now found this PHP:
But Im getting this error:
---------------
I will update first post with the solution:
---------------
Ok, since Lucaz coulnd't made the system yet, I will keep trying to guide the topic to do what I need:
PHP - How to login e-mail and password? Just found some configurations at php.ini (from google)
Code:
; Define the anonymous ftp password (your email address). PHP's default setting
; for this is empty.
; http://php.net/from
;from="[email protected]"
....
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
PHP - This is the code to send an e-mail, easy programable to get e-mail from account and generate a new account and send a new password*.
Code:
<?php $to = "[email protected]";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
?>
PHP - Generating a random password on SHA1:
Code:
$algorythm = "sha1";
$salt = hash($algorythm, uniqid(rand(), true));
The problem here is to decript the password, because we need to update account's password at database, but also we need to send an e-mail to the requester with the new password.
------------------------------
Now found this PHP:
Lua:
<?phpdate_default_timezone_set('America/El_Salvador'); //Se define la zona horaria
require_once('class.phpmailer.php'); //Incluimos la clase phpmailer
$mail = new PHPMailer(true); // Declaramos un nuevo correo, el parametro true significa que mostrara excepciones y errores.
$mail->IsSMTP(); // Se especifica a la clase que se utilizará SMTP
try {
//------------------------------------------------------
$correo_emisor="[email protected]"; //Correo a utilizar para autenticarse
//con Gmail o en caso de GoogleApps utilizar con @tudominio.com
$nombre_emisor="Dani Filth"; //Nombre de quien envía el correo
$contrasena="password_from_hell"; //contraseña de tu cuenta en Gmail
$correo_destino="[email protected]"; //Correo de quien recibe
$nombre_destino="Shagrath"; //Nombre de quien recibe
//--------------------------------------------------------
$mail->SMTPDebug = 2; // Habilita información SMTP (opcional para pruebas)
// 1 = errores y mensajes
// 2 = solo mensajes
$mail->SMTPAuth = true; // Habilita la autenticación SMTP
$mail->SMTPSecure = "ssl"; // Establece el tipo de seguridad SMTP
$mail->Host = "smtp.gmail.com"; // Establece Gmail como el servidor SMTP
$mail->Port = 465; // Establece el puerto del servidor SMTP de Gmail
$mail->Username = $correo_emisor; // Usuario Gmail
$mail->Password = $contrasena; // Contraseña Gmail
//A que dirección se puede responder el correo
$mail->AddReplyTo($correo_emisor, $nombre_emisor);
//La direccion a donde mandamos el correo
$mail->AddAddress($correo_destino, $nombre_destino);
//De parte de quien es el correo
$mail->SetFrom($correo_emisor, $nombre_emisor);
//Asunto del correo
$mail->Subject = 'Prueba de phpMailer en Garabatos Linux';
//Mensaje alternativo en caso que el destinatario no pueda abrir correos HTML
$mail->AltBody = 'Hijole para ver el mensaje necesita un cliente de correo compatible con HTML.';
//El cuerpo del mensaje, puede ser con etiquetas HTML
$mail->MsgHTML("<strong>¿Que otro nombre recibe el área de sol del Estadio Cuscatlán?</strong>");
//Archivos adjuntos
$mail->AddAttachment('img/logo.jpg'); // Archivos Adjuntos
//Enviamos el correo
$mail->Send();
echo "Mensaje enviado. Que chivo va vos!!";
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Errores de PhpMailer
} catch (Exception $e) {
echo $e->getMessage(); //Errores de cualquier otra cosa.
}
?>
But Im getting this error:
Code:
A PHP Error was encountered
Severity: Warning
Message: require_once(class.phpmailer.php): failed to open stream: No such file or directory
Filename: pages/sendmail.php
Line Number: 3
Last edited: