Minimal CORS mail PHP
1

From looking on the script, seems there is nothing that can be slow except of the mail(). The problem is, it needs to connect with the target mail server and thats often very slow.

mail() got many problems so it is best avoid using it. You can read about it here and here

The best alternative is probably Swiftmailer http://swiftmailer.org/. With that  you can solve also your "in background sending" using spool. Your mails will be send after the script finished running.

For the next two questions I would advise to handle your script like an HTTP API.

2

With Spool

you cannot know in real time if sending of your email was an success, as this will happen after your script will terminate.

Without Spool

it could still be faster (or not), but you will know if it was ok right away

What to return depend now on the above

You can use standard response codes, almost for all your scenarios. http_status_codes
You don't need to return anything in the body most of the time.

Fail:


400 - Bad Request - when the request is missing $msg, or body json is malformed 
401 - Unauthorized - when missing http_origin or not in the list of allowed
405 - Method not allowed - if it is not POST or OPTIONS
409 - Conflict - email sending failed (if not usign spool)


Success:


200 - OK - email send successfully (if not using spool)
202 - Accepted - when everything is ok, but using spool so you don't know if the sending of email was successfull


In an API approach you would be able to call some url to check if your Accepted request was done processing or not, but this is another topic.

3

As I said before, this is basically an API, so all methods how to secure an API apply here. You can study those.
If you want to go simple and quick the easier ones are:


SSL + Http Basic Auth - simple basic auth when going over https is quite secure
SSL + ApiKey in header + Token Auth - basic thing for all API


I would not recommend going without SSL as you can always catch the request and read the keys.