Derek Jones | 0b59f27 | 2008-05-13 04:22:33 +0000 | [diff] [blame] | 1 | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
Derek Allard | 5a34f04 | 2008-01-19 19:41:54 +0000 | [diff] [blame] | 2 | /**
|
| 3 | * CodeIgniter
|
| 4 | *
|
| 5 | * An open source application development framework for PHP 4.3.2 or newer
|
| 6 | *
|
| 7 | * @package CodeIgniter
|
| 8 | * @author ExpressionEngine Dev Team
|
| 9 | * @copyright Copyright (c) 2006, EllisLab, Inc.
|
Derek Jones | 7a9193a | 2008-01-21 18:39:20 +0000 | [diff] [blame] | 10 | * @license http://codeigniter.com/user_guide/license.html
|
| 11 | * @link http://codeigniter.com
|
Derek Allard | 5a34f04 | 2008-01-19 19:41:54 +0000 | [diff] [blame] | 12 | * @since Version 1.0
|
| 13 | * @filesource
|
| 14 | */
|
| 15 |
|
| 16 | // ------------------------------------------------------------------------
|
| 17 |
|
| 18 | /**
|
| 19 | * CodeIgniter Email Helpers
|
| 20 | *
|
| 21 | * @package CodeIgniter
|
| 22 | * @subpackage Helpers
|
| 23 | * @category Helpers
|
| 24 | * @author ExpressionEngine Dev Team
|
Derek Jones | 7a9193a | 2008-01-21 18:39:20 +0000 | [diff] [blame] | 25 | * @link http://codeigniter.com/user_guide/helpers/email_helper.html
|
Derek Allard | 5a34f04 | 2008-01-19 19:41:54 +0000 | [diff] [blame] | 26 | */
|
| 27 |
|
| 28 | // ------------------------------------------------------------------------
|
| 29 |
|
| 30 | /**
|
| 31 | * Validate email address
|
| 32 | *
|
| 33 | * @access public
|
| 34 | * @return bool
|
| 35 | */
|
Derek Jones | 0b59f27 | 2008-05-13 04:22:33 +0000 | [diff] [blame] | 36 | if ( ! function_exists('valid_email'))
|
Derek Allard | 5a34f04 | 2008-01-19 19:41:54 +0000 | [diff] [blame] | 37 | {
|
Derek Jones | 269b942 | 2008-01-28 21:00:20 +0000 | [diff] [blame] | 38 | function valid_email($address)
|
| 39 | {
|
Derek Jones | 0b59f27 | 2008-05-13 04:22:33 +0000 | [diff] [blame] | 40 | return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) ? FALSE : TRUE;
|
Derek Jones | 269b942 | 2008-01-28 21:00:20 +0000 | [diff] [blame] | 41 | }
|
Derek Allard | 5a34f04 | 2008-01-19 19:41:54 +0000 | [diff] [blame] | 42 | }
|
| 43 |
|
| 44 | // ------------------------------------------------------------------------
|
| 45 |
|
| 46 | /**
|
| 47 | * Send an email
|
| 48 | *
|
| 49 | * @access public
|
| 50 | * @return bool
|
| 51 | */
|
Derek Jones | 0b59f27 | 2008-05-13 04:22:33 +0000 | [diff] [blame] | 52 | if ( ! function_exists('send_email'))
|
Derek Allard | 5a34f04 | 2008-01-19 19:41:54 +0000 | [diff] [blame] | 53 | {
|
Derek Jones | 269b942 | 2008-01-28 21:00:20 +0000 | [diff] [blame] | 54 | function send_email($recipient, $subject = 'Test email', $message = 'Hello World')
|
| 55 | {
|
| 56 | return mail($recipient, $subject, $message);
|
| 57 | }
|
Derek Allard | 5a34f04 | 2008-01-19 19:41:54 +0000 | [diff] [blame] | 58 | }
|
| 59 |
|
Derek Jones | 0b59f27 | 2008-05-13 04:22:33 +0000 | [diff] [blame] | 60 |
|
| 61 | /* End of file email_helper.php */
|
Derek Jones | a3ffbbb | 2008-05-11 18:18:29 +0000 | [diff] [blame] | 62 | /* Location: ./system/helpers/email_helper.php */ |