blob: b44fae554202d4286928f59c8e851b1680162431 [file] [log] [blame]
Derek Allard5a34f042008-01-19 19:41:54 +00001<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
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 Jones7a9193a2008-01-21 18:39:20 +000010 * @license http://codeigniter.com/user_guide/license.html
11 * @link http://codeigniter.com
Derek Allard5a34f042008-01-19 19:41:54 +000012 * @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 Jones7a9193a2008-01-21 18:39:20 +000025 * @link http://codeigniter.com/user_guide/helpers/email_helper.html
Derek Allard5a34f042008-01-19 19:41:54 +000026 */
27
28// ------------------------------------------------------------------------
29
30/**
31 * Validate email address
32 *
33 * @access public
34 * @return bool
35 */
36function valid_email($address)
37{
38 return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) ? FALSE : TRUE;
39}
40
41// ------------------------------------------------------------------------
42
43/**
44 * Send an email
45 *
46 * @access public
47 * @return bool
48 */
49function send_email($recipient, $subject = 'Test email', $message = 'Hello World')
50{
51 return mail($recipient, $subject, $message);
52}
53
54?>