Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 1 | ############ |
| 2 | Email Helper |
| 3 | ############ |
| 4 | |
| 5 | The Email Helper provides some assistive functions for working with |
| 6 | Email. For a more robust email solution, see CodeIgniter's :doc:`Email |
| 7 | Class <../libraries/email>`. |
| 8 | |
| 9 | .. contents:: Page Contents |
| 10 | |
| 11 | Loading this Helper |
| 12 | =================== |
| 13 | |
| 14 | This helper is loaded using the following code:: |
| 15 | |
| 16 | $this->load->helper('email'); |
| 17 | |
| 18 | |
| 19 | The following functions are available: |
| 20 | |
| 21 | valid_email('email') |
| 22 | ==================== |
| 23 | |
| 24 | Checks if an email is a correctly formatted email. Note that is doesn't |
| 25 | actually prove the email will recieve mail, simply that it is a validly |
| 26 | formed address. |
| 27 | |
| 28 | It returns TRUE/FALSE |
| 29 | |
| 30 | :: |
| 31 | |
| 32 | $this->load->helper('email'); |
| 33 | |
| 34 | if (valid_email('email@somesite.com')) |
| 35 | { |
| 36 | echo 'email is valid'; |
| 37 | } |
| 38 | else |
| 39 | { |
| 40 | echo 'email is not valid'; |
| 41 | } |
| 42 | |
| 43 | send_email('recipient', 'subject', 'message') |
| 44 | ============================================= |
| 45 | |
| 46 | Sends an email using PHP's native |
| 47 | `mail() <http://www.php.net/function.mail>`_ function. For a more robust |
| 48 | email solution, see CodeIgniter's :doc:`Email |
| 49 | Class <../libraries/email>`. |