The sentence you mentioned is a fixture in formal letter writing. It is similar (but not necessarily identical) in function to starting to write the body of a letter with:
"I hope this letter finds you in good health."
~におかれましては is collocation used as an indirect pointer to 先生 (a person with seniority, such as teacher)
Indirectness is a style used for very formal "keigo."
In essence, 先生におかれましては means 先生は
This is related to ~においては which is used to refer to oneself or someone on one's side (family, company, etc.)
ますますお元気でご活躍のことと存じます is also a keigo form to mean "I know/hope that you are [all the more] in good health and active (in the person's profession, personal life, etc.)"
There is much more to explain, if you want to break it down further... But I'm lazy...