PHP mail inside function with if/else statements
<p>Trying to get my script to send me an email if the file uploads successfully. Here is my part of the script that saves the file to the server as username.site.zip:</p>

<pre><code> if ($this-&gt;file-&gt;save($uploadDirectory . $_SESSION['myusername'] . '.site.' . $ext)){
        return array('success'=&gt;true);}
    else {      
        return array('error'=&gt; 'Could not save uploaded file.' .
            'The upload was cancelled, or server error encountered');
    }
</code></pre>

<p>I'm not quite sure how to add in the mail function so that if it's success=>true then it sends mail('email@domain.com','subject','body');</p>

<p>Any help would be great.</p>
