Setup mail relay on raspbian using gmail

apt-get -y install msmtp msmtp-mta mailutils

touch /etc/msmtprc
chmod 640 /etc/msmtprc

## Google Account => Security => 
## - Login with 2 step verification (MFA) (Mobile with SMS code)
## - App-password creating for "Other" device => Key generate
## On E-mail client on linux replace password with this key from above!!

vi /etc/msmtprc
# Gmail specifics
# Accounts will inherit settings from this section
defaults
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
host smtp.gmail.com
port 587
from <info@FQDN>
user <UserName>@gmail.com
password <Password>  => Password has become a mandatory key which you can configure after setting up MFA in your Google Account!!!!
# Default
account default : gmail

 

  Donate now via the Paypal button on the top in US Dollar and on the bottom in Euro