Linux – Sending email from the server

emaillinux

So, I'd like to send email from my server.

I installed mailx

apt-get install mailx

But a command like

mail -s "Hello world" me@gmail.com

Is actually giving an error in /var/spool/mail/ which says:

Mailing to remote domains not supported.

Why is that happening?

Best Answer

What MTA are you using locally? mail just gives you the ability to form a mail message, but you still need and MTA to do the actual delivery? By default, most distributions come with sendmail. You'll likely need to install another MTA or configure the current one to support outside delivery.