PHP - Why am I getting this error? Call to undefined function
<p>I am new to php, so sorry if this is lame.</p>

<p>I have a simple class that has two private functions. For some reason when I try to call <code>_sendInvalidEmailNotice()</code> I get an error stating that the function is undefined.</p>

<p>What am I doing wrong?</p>

<pre><code>class Mail extends CI_Controller {

    function __construct() {
        parent::__construct();
        $this - &gt; load - &gt; helper('email');
    }

    function _sendMessage($message) {
        send_email('name@gmail.com', 'Test Email', $message);
        $success = array('success' = &gt; 'Mail Sent');
        echo json_encode($success);
    }

    function _sendInvalidEmailNotice() {
        $errorMessage = array('error' = &gt; 'Invalid Email Address');
        echo json_encode($errorMessage);
    }

    public
    function sendMail($returnAddress, $message) {
        if (valid_email($returnAddress)) {
            _sendMessage($message);
        } else {
            _sendInvalidEmailNotice();
        }
    }


}
</code></pre>
