IP changes are not your concern. It is likely that your ISP blocks outgoing port 25, you can check with nc gmail-smtp-in.l.google.com 25
and if you don’t get any output its blocked. If you don’t have very many users on your Pterodactyl server, I would suggest just using a gmail account with SMTP in pterodactyl. If you have port 25 unblocked and want to selfhost email, mailcow is a great option and really easy to set up.
Alpine Linux edge