A lot has changed since this question was asked, but possibly this answer provides a helpful approach.
The simple mail processing you're asking about opens a security hole, as noted by others. But you could patch that hole with an additional confirmation step.
In the basic version, after your server receives your instructions mail, it would then send a confirmation code to your mail account (lets keep its generation another topic), for which it would then wait to be echoed by you. Only then would it proceed with the instructions you had sent in the first mail.
This solution can have enriched variations. One part of them would be operations on the code itself. Another way to improve the safety is to open a new communication channel. You might connect another mobile device to the server, which would send to you the authorisation code as an SMS. This way you would also get informed in the event of someone trying to send instructions to your server.