Losing weight while pregnant...

I am (almost) 240 and 5 feet. I am not happy that I've allowed myself to get this big. I was an average weight growing up and when I got pregnant with my first 11 years ago I was 183lbs. I was okay with that weight. My current husband loves me the way I am and wants me to do what makes me happy. He is encouraging and really just wants me to be healthy.

He is honestly the biggest reason I am trying to lose weight as safely and healthy as I can with how unhappy I am about my weight and the biggest reason I haven't lost all self esteem and am actually gaining some back.

I am going to talk to my doctor about safely losing weight or at least a healthy amount to gain while pregnant.

I was wondering if dietary supplements and "lose weight" pills were safe while pregnant? Is it safe to start going to the gym now if you haven't gone before getting pregnant? Losing weight can always wait 9 months so my baby can be as healthy as possible.