That's one alternative, but a better idea might be to volunteer to send a healthy treat for all the children! Better yet, discuss your concerns with the classroom teacher. It has been my experience that teachers would eliminate the candy and sweets altogether from the school day, but they continue to allow them because it's easier for busy parents.
I know one innovative teacher who asks parents to contribute a single raw vegetable (cleaned and cut up, or a convenience bag purchased in the produce section) for class celebrations. She serves a yogurt-based dip and a veggie tray for class celebrations. Allowable beverages are juice only (no juice drinks). The children have just as much fun.
Our parenting advice is given as suggestions only. We recommend you also consult your healthcare provider, and urge you to contact them immediately if your question is urgent or about a medical condition.