Last active
May 15, 2017 18:15
-
-
Save ziemekpr0/767229f3cdfa18e85e69b2a514e56042 to your computer and use it in GitHub Desktop.
Funkcja wysyłająca wiadomości email przy pomocy frameworku CodeIgniter
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
<?php | |
function send_email($recipent_email, $subject, $message) | |
{ | |
$this->load->library('email'); | |
$this->email->from('no-reply@domena.pl', 'Nadawca'); | |
$this->email->to($recipent_email); | |
$this->email->subject($subject); | |
$this->email->message($message); | |
return ($this->email->send()) ? TRUE : FALSE; | |
// albo | |
if ($this->email->send()) | |
echo "Wiadomość została wysłana!"; | |
else | |
echo "Wystąpił błąd podczas wysyłania wiadomości!"; | |
// wyświetl błędy | |
echo $this->email->print_debugger(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment