Skip to content

Instantly share code, notes, and snippets.

@zamith
Last active December 16, 2015 17:50
Show Gist options
  • Save zamith/5473447 to your computer and use it in GitHub Desktop.
Save zamith/5473447 to your computer and use it in GitHub Desktop.
<?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: notesXchange@hotmail.com\r\n" . "X-Mailer: php";
header('location: utilizadores_listar.php?msg=OK');
etc...
}
}
?>
<?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