Yes and no.
It's certainly possible to make a MTA talk SMTP over a nonstandard port – but only if the server on the other end is expecting that. And you'll find that nobody, ever, listens for SMTP on port 80 – so your server would spend most of its time trying to talk with someone's Apache. For server-to-server mail exchange (MX), it's port 25, end of story.
So you cannot just change the port. Rather, instead of connecting directly to the recipients' mail servers (from MX records), your MTA would need to relay all mail through a specific server that's been configured to accept SMTP on port 80.
But doing that is relatively easy, as long as you have a second server that is allowed to send mail. Install a MTA there (e.g. OpenSMTPD or Postfix), configure it to listen on port 80 and to trust your "source" server's IP address for relaying. (Alternatively, instead of an IP whitelist, SMTP username/password authentication would even be better.)
Here's an (untested) OpenSMTPD example:
table relay-in-ip { "12.34.56.78" }
listen on 0.0.0.0 port 80 tls-require
listen on :: port 80 tls-require
accept from source <relay-in-ip> for any relay
Similarly, for authenticated SMTP:
table relay-in-auth { "someuser"="somepassword" }
listen on 0.0.0.0 port 80 tls-require auth <relay-in-auth> tag AUTHED
listen on :: port 80 tls-require auth <relay-in-auth> tag AUTHED
accept tagged AUTHED from any for any relay
(Make sure to actually test the relay server – it would be Bad™ if it allowed the whole internet to relay messages without authentication.
Once you have that set up, it usually takes just a single setting on the "source" server to relay all mail – depending on the MTA, the option might be named "relay host" or "smarthost", and it almost always accepts a host:port specification:
accept for any relay via "tls://relay.example.com:80"
If authentication is needed:
table relay-out-auth { "foo"="someuser:somepassword" }
accept for any relay via "tls+auth://foo@smtp.gmail.com:587" auth <relay-out-auth>
You could use an email service that provides a web API, like https://sendgrid.com/docs/API_Reference/Web_API/index.html
– Der Hochstapler – 2014-11-26T21:02:52.760this is an interesting idea but I would rather not send this information over a third party... – idipous – 2014-11-26T21:15:56.237