apt install postfix
apt install mailutils
cd /etc/postfix
vi /[Link]
comment
#smtp_tls_security_level=may
Add
relayhost = [[Link]]:587
myhostname = prashant-server
and comment to old one
#myhostname = [Link]-WA850RE
And at the end of line
smtp_sasl_auth_enable = yes
smtp_tls_security_level = encrypt
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
smtp_sasl_security_options = noanonymous
save the file
++++
cd sasl
touch sasl_passwd
vi sasl_passwd
add following
[[Link]]:587 xyz@[Link]:apppassword
then save and exit
then make the db file with following command
postmap sasl_passwd
after that you may remove the sasl_passwd as new sasl_passwd.db file has been
created and will be used for sending email
To send the email run following command
echo "This is Mail Content" | mail -s "Subject of Mail"
prashantsinharanchi@[Link]
To send email with attachment use following command
echo "This is Mail Content" | mail -s "Subject of Mail" -A file1
prashantsinharanchi@[Link]