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:
if ($this->file->save($uploadDirectory . $_SESSION['myusername'] . '.site.' . $ext)){
return array('success'=>true);}
else {
return array('error'=> 'Could not save uploaded file.' .
'The upload was cancelled, or server error encountered');
}
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’);
Any help would be great.
You had it. Not sure what you still needed.