How do I allow port 587 accept sendgrid API

Hey there I can’t seem to sent transaction email and this is the error message I am getting

:x: Port 25 is open, but not to api.sendgrid.com.
:x: Port 587 is open, but not to api.sendgrid.com.
:x: Port 465 is open, but not to api.sendgrid.com.