Send Email to Mail Relay Service from Linux

One time, in the medium to large business network, because the restrictions on access to external network we need to send an email to the mail relay service. This method looks good for security reasons because you do not have to open all ports for each server to allow sending an email.

Here is how to setup a Linux server to send mail to the mail service relay: