I have installed the SMTP module, and the test email is working fine and displays no error. I have also installed the webform module through which I am sending emails using an email handler. Whenever i hit rest api {{url}}/webform_rest/submit, i get the following error:
RuntimeException: Failed to start the session because headers have already been sent by ".....\phpmailer\phpmailer\src\SMTP.php" at line 283. in Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (line 152 of .....\symfony\http-foundation\Session\Storage\NativeSessionStorage.php)