Setup mail relay on raspbian using gmail

apt-get -y install msmtp msmtp-mta mailutils

touch /etc/msmtprc
chmod 640 /etc/msmtprc

vi /etc/msmtprc
# Gmail specifics
# Accounts will inherit settings from this section
auth on
tls on
tls_certcheck off
# tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile /var/log/msmtp.log
aliases /etc/aliases
# Gmail specifics
account gmail
port 587
from <info@FQDN>
user <UserName>
password <Password>
# Default
account default : gmail

  If you appreciate my website feel free to donate via the Paypal button...Small amount for a coffee is enough;-) Thanks!