The following setup describes a postix setup to send e-mails using an existing SMTP server. It is not designed to receive e-mails. My provider is DreamHost, but setup should be very similar with other hosters. I used a VM with the Ubuntu Server 16.04.1 out of the box installtion (ubuntu-16.04.1-server-amd64). This VM has no real FQDN, hence an imaginary needs to be configured in order to make the SMPT server accept sent e-mails.

These packages are required, but might be installed already.

root@vmtest:~# apt-get install libsasl2-modules
Reading package lists... Done
Building dependency tree
Reading state information... Done
libsasl2-modules is already the newest version (2.1.26.dfsg1-14build1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


Installation of the utility "mail" is desired and/or necessary (used here for testing only).

root@vmtest:~# apt-get install mailutils


Install postfix. Select "Internet Site" (General type of mail configuration:) and enter "vmtest.mydomain.local" (System mail name:) as domainname.

root@vmtest:~# apt-get install postfix
...


Modify following lines in /etc/postfix/main.cf:

...
#append_dot_mydomain = no
append_dot_mydomain = yes
...
#relayhost =
relayhost = [mail.mydomain.com]:587
...


Add following lines at the bottom of /etc/postfix/main.cf:

...
# add mydomain
mydomain = mydomain.local
# enable SASL authentication
smtp_sasl_auth_enable = yes
# disallow methods that allow anonymous authentication.
smtp_sasl_security_options = noanonymous
# where to find sasl_passwd
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
# Enable STARTTLS encryption
smtp_use_tls = yes
# where to find CA certificates
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt


Setup access to SMTP server, generate sasl_passwd.db, change owner/group & permissions, restart postfix and run a test:

root@vmtest:~# nano /etc/postfix/sasl_passwd
...
root@vmtest:~# cat /etc/postfix/sasl_passwd
[]:587 @
root@vmtest:~# postmap /etc/postfix/sasl_passwd
root@vmtest:~# ls -l /etc/postfix/sasl_*
-rw-r--r-- 1 root root    61 Dec 31 16:40 /etc/postfix/sasl_passwd
-rw-r--r-- 1 root root 12288 Dec 31 16:40 /etc/postfix/sasl_passwd.db
root@vmtest:~# chown root:root /etc/postfix/sasl_*
root@vmtest:~# chmod 600 /etc/postfix/sasl_*
root@vmtest:~# ls -l /etc/postfix/sasl_*
-rw------- 1 root root    61 Dec 31 16:40 /etc/postfix/sasl_passwd
-rw------- 1 root root 12288 Dec 31 16:40 /etc/postfix/sasl_passwd.db
root@vmtest:~# service postfix restart
root@vmtest:~# echo "Body of email" | mail -s "Subject of email" me@mydomain.com


Logs are stored in /var/logs/mail.log

References:
Postfix on a null client
Configure Postfix to send mail using an external SMTP Server
DreamHost Forum - postfix issue