Урок - Email Helper

Главная » Курсы » Курс CodeIgniter® 2.2 » Урок - Email Helper

Обучающий онлайн курс
CodeIgniter® 2.2

Обучающий курс по CMF CodeIgniter® 2.2.
Лицензия: Лицензия Creative Commons.

The Email Helper provides some assistive functions for working with Email. For a more robust email solution, see CodeIgniter's Email Class.

 

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() function. For a more robust email solution, see CodeIgniter's Email Class.