summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/helpers/email_helper.rst
blob: d4e94b1ed4d6d2964da22eb7f037f505ab69c7ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
############
Email Helper
############

The Email Helper provides some assistive functions for working with
Email. For a more robust email solution, see CodeIgniter's :doc:`Email
Class <../libraries/email>`.

.. contents:: Page Contents

Loading this Helper
===================

This helper is loaded using the following code::

	$this->load->helper('email');


The following functions are available:

valid_email('email')
====================

Checks if an email is a correctly formatted email. Note that is doesn't
actually prove the email will recieve mail, simply that it is a validly
formed address.

It returns TRUE/FALSE

::

	$this->load->helper('email');

	if (valid_email('email@somesite.com'))
	{
		echo 'email is valid';
	}
	else
	{
		echo 'email is not valid';
	}

send_email('recipient', 'subject', 'message')
=============================================

Sends an email using PHP's native
`mail() <http://www.php.net/function.mail>`_ function. For a more robust
email solution, see CodeIgniter's :doc:`Email
Class <../libraries/email>`.