title: Call to a member function header() on null in Cors Middleware in lumen
body: <p><a href="https://i.stack.imgur.com/FFL2h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FFL2h.png" alt="enter image description here" /></a></p>
  <p>hello everyone. I have cors middleware in my lumen as above. cors midlleware works normally when i make a request to lumen from my app. however, whenever a function that I need to send mail runs, I get the error &quot;Call to a member function header() on null&quot;.</p>