-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from bhamidou/develop
Develop
- Loading branch information
Showing
10 changed files
with
452 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,15 +4,12 @@ | |
|
||
use PHPMailer\PHPMailer\PHPMailer; | ||
use PHPMailer\PHPMailer\SMTP; | ||
|
||
require_once 'phpmailer/src/Exception.php'; | ||
require_once 'phpmailer/src/PHPMailer.php'; | ||
require_once 'phpmailer/src/SMTP.php'; | ||
|
||
require_once __DIR__.'/phpmailer/src/Exception.php'; | ||
require_once __DIR__.'/phpmailer/src/PHPMailer.php'; | ||
require_once __DIR__.'/phpmailer/src/SMTP.php'; | ||
class Mail { | ||
public function sendmail($destinomail, $destinonombre, $asunto, $newPass) | ||
static function sendmail($email, $name, $newpass) | ||
{ | ||
|
||
try { | ||
$mail = new PHPMailer(); | ||
//Configuración del servidor | ||
|
@@ -29,7 +26,7 @@ public function sendmail($destinomail, $destinonombre, $asunto, $newPass) | |
$mail->setFrom(Constantes::$MAILUsername, Constantes::$MAILFromName); | ||
|
||
//Destinatarios | ||
$mail->addAddress($destinomail, $destinonombre); //Añadir un destinatario, el nombre es opcional | ||
$mail->addAddress($email, $name); //Añadir un destinatario, el nombre es opcional | ||
|
||
//Destinatarios opcionales | ||
// $mail->addReplyTo('[email protected]', 'Information'); //Responder a | ||
|
@@ -41,14 +38,15 @@ public function sendmail($destinomail, $destinonombre, $asunto, $newPass) | |
|
||
//Nombre opcional | ||
$mail->isHTML(true); //Establecer el formato de correo electrónico en HTMl | ||
$mail->Subject = $asunto; | ||
$mail->Body = `<meta charset="ISO-8859-1"> ¡Su nueva contraseña es: <b>$newPass</b>`; | ||
$mail->AltBody = 'Desde Gitignore Tech esperemos que disfrute de su cuenta'; | ||
$mail->Subject = "New Password!"; | ||
$mail->Body = "Su nueva contraseña es: <b>$newpass</b> <br>Desde Gitignore Tech esperemos que disfrute de su cuenta"; | ||
|
||
|
||
$mail->send(); //Enviar correo eletrónico | ||
|
||
echo "llego hasta aquí"; | ||
} catch (Exception $e) { | ||
|
||
echo $e; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.