Skip to content

Commit f043617

Browse files
committed
Fix #16: Add the email helper back to the repo to reduce backward compatibility issues.
1 parent d68db8c commit f043617

1 file changed

Lines changed: 85 additions & 0 deletions

File tree

system/helpers/email_helper.php

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?php
2+
/**
3+
* CodeIgniter
4+
*
5+
* An open source application development framework for PHP
6+
*
7+
* This content is released under the MIT License (MIT)
8+
*
9+
* Copyright (c) 2019 - 2022, CodeIgniter Foundation
10+
*
11+
* Permission is hereby granted, free of charge, to any person obtaining a copy
12+
* of this software and associated documentation files (the "Software"), to deal
13+
* in the Software without restriction, including without limitation the rights
14+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15+
* copies of the Software, and to permit persons to whom the Software is
16+
* furnished to do so, subject to the following conditions:
17+
*
18+
* The above copyright notice and this permission notice shall be included in
19+
* all copies or substantial portions of the Software.
20+
*
21+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27+
* THE SOFTWARE.
28+
*
29+
* @package CodeIgniter
30+
* @author EllisLab Dev Team
31+
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
32+
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
33+
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
34+
* @license https://opensource.org/licenses/MIT MIT License
35+
* @link https://codeigniter.com
36+
* @since Version 1.0.0
37+
* @filesource
38+
*/
39+
defined('BASEPATH') OR exit('No direct script access allowed');
40+
41+
/**
42+
* CodeIgniter Email Helpers
43+
*
44+
* @package CodeIgniter
45+
* @subpackage Helpers
46+
* @category Helpers
47+
* @author EllisLab Dev Team
48+
* @link https://codeigniter.com/userguide3/helpers/email_helper.html
49+
*/
50+
51+
// ------------------------------------------------------------------------
52+
53+
if ( ! function_exists('valid_email'))
54+
{
55+
/**
56+
* Validate email address
57+
*
58+
* @deprecated 3.0.0 Use PHP's filter_var() instead
59+
* @param string $email
60+
* @return bool
61+
*/
62+
function valid_email($email)
63+
{
64+
return (bool) filter_var($email, FILTER_VALIDATE_EMAIL);
65+
}
66+
}
67+
68+
// ------------------------------------------------------------------------
69+
70+
if ( ! function_exists('send_email'))
71+
{
72+
/**
73+
* Send an email
74+
*
75+
* @deprecated 3.0.0 Use PHP's mail() instead
76+
* @param string $recipient
77+
* @param string $subject
78+
* @param string $message
79+
* @return bool
80+
*/
81+
function send_email($recipient, $subject, $message)
82+
{
83+
return mail($recipient, $subject, $message);
84+
}
85+
}

0 commit comments

Comments
 (0)