Last active
December 16, 2015 17:50
-
-
Save zamith/5473447 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
class UserMailer { | |
private $user = null; | |
public function __construct(user) | |
{ | |
$this->$user = user; | |
} | |
public function activation_deliver() | |
{ | |
// Código de enviar mail | |
$message = "Obrigado por registares uma conta no NotesXchange. Aqui estão os detalhes da tua conta:\n\n | |
Email: $this->$user->$email \n | |
Password: $this->$user->$pass \n | |
Acede a este link para activares a tua conta: \n | |
_______________________________________________________________________ | |
*** LINK DE ACTIVAÇÃO ***** \n | |
http://$host$uri/activate.php?usr=$this->$user->$email \n\n | |
_______________________________________________________________________ | |
Muito obrigado. Esta é uma resposta automática. POR FAVOR NÃO RESPONDA."; | |
$to = $this->$user->$email; | |
$subject = "Pedido de login para NotesXchange"; | |
$body = $message; | |
$headers = "From: [email protected]\r\n" . "X-Mailer: php"; | |
header('location: utilizadores_listar.php?msg=OK'); | |
etc... | |
} | |
} | |
?> |
This file contains hidden or 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
<?php | |
$user = new User; | |
$mailer = new UserMailer($user); | |
// Enviar mail | |
$mailer->activation_deliver(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment