When i try to connect my mail server from outside of the my server ot works, but when i try to coonect my server from my server it doesn't work

when i try to connect my mail server from outside of the my server ot works, but when i try to coonect my server from my server it doesn’t work. i have also enabled ports