Some cloud providers like Google Cloud Platform may block port 25 by default to prevent SPAM email.
We can use a plugin, e.g. WP Mail SMTP, to set a specific port easily. Please see How to Set Up the Other SMTP Mailer in WP Mail SMTP for details.