Dear Mr./Ms. Bossname
Due to health reasons, I must formally submit my resignation from (company), effective as soon as possible.
As we discussed, I have been suffering from (symptoms) and was recently diagnosed with (diagnosis). Unfortunately, the responsibilities required by my position mean that I run the risk of aggravating and accelerating the problem.
I leave my position with great regret. I have sincerely enjoyed my work, and I have appreciated all of the opportunities that you and this company have offered me. However, I feel that I must see to my health at this time.
This has been a wonderful place to work. I hope that, in the possible case of a full recovery, I can contact you again about open positions within the company.