Joe Manganiello has told how he spent "months and months heavily medicated" during a lengthy battle with a "deadly mystery illness".