Magento 2.3.4 order and comment email stops working after upgrading from PHP 7.1 to 7.2


I’m having an issue when upgrading my PHP version to 7.2 to get ready for a system upgrade to Magento 2.4 and the backend email system stops working. I don’t receive new order emails and can’t send out comment emails to customers. Any ideas?