In the new era of connectivity, marked by the explosive number of wireless electronic devices and the need for smart and pervasive applications, Machine-to-Machine (M2M) communications are an emerging technology that enables the seamless device interconnection without the need of human interaction. The use of M2M technology can bring to life a wide range of mHealth applications, with considerable benefits for both patients and healthcare providers. Many technological challenges have to be met, however, to ensure the widespread adoption of mHealth solutions in the future. In this context, we aim to provide a comprehensive survey on M2M systems for mHealth applications from a wireless communication perspective. An end-to-end holistic approach is adopted, focusing on different communication aspects of the M2M architecture. Hence, we first provide a systematic review of Wireless Body Area Networks (WBANs), which constitute the enabling technology at the patient's side, and then discuss end-to-end solutions that involve the design and implementation of practical mHealth applications. We close the survey by identifying challenges and open research issues, thus paving the way for future research opportunities.