Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //moznost #1
- public function send()
- {
- if (!mail($this->to, $this->subject, $this->message, $headers)) {
- throw new Exception('Send e-mail failed');
- }
- }
- try {
- $mail->send();
- $this->setFlashMessage('success', 'E-mail pre obnovenie hesla bol odoslaný na vašu adresu.');
- } catch (Exception $e) {
- $this->setFlashMessage('danger', 'Pokus o obnovenie hesla bol neúspešný.');
- }
- //moznost #2
- public function send()
- {
- if (!mail($this->to, $this->subject, $this->message, $headers)) {
- return false;
- }
- return true;
- }
- try {
- if (!$mail->send()) {
- throw new Exception('Send e-mail failed');
- }
- $this->setFlashMessage('success', 'E-mail pre obnovenie hesla bol odoslaný na vašu adresu.');
- } catch (Exception $e) {
- $this->setFlashMessage('danger', 'Pokus o obnovenie hesla bol neúspešný.');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement