You can configure Postfix to use the gmail smtp server to deliver the email.
You can follow the following steps.
1. Install Postfix and configuration use Internet Site.
sudo apt-get install libsasl2-modules postfix
2. Generate an App Password for PostfixPermalink
3. Manage your account access and security settings. Scroll down to “Password & sign-in method” and click 2-Step Verification.
4. Generate an App password for Postfix:
5. Make note of the newly generated app password.
6. In Postfix main.cf
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes
7. Add Gmail Username and Password to Postfix, create /etc/postfix/sasl_passwd and enter the following information.
[smtp.gmail.com]:587 cfialab@gmail.com:XXXXXXXXcwop
8. Create the hash db file for Postfix by running the postmap command
postmap /etc/postfix/sasl_passwd
Use Mutt to automate the mail.
echo "MESSAGE BODY" | mutt -s "SUBJECT" -a ./access.log.txt -- dayaramb@gmail.com