Useful shortcuts for vi editor

Thursday 4 October 2018

How to setup/configure/use mailx for Office365 account?

-> Update the OS
# yum -y update
or (y -> yes)
# yum update

-> Install mailx
# yum install -y mailx

-> Define soft link to use "email" the command
# ln -s /bin/mailx /bin/email

-> Prepare config file
# vi /etc/mail.rc
set smtp=outlook.office365.com
set smtp-auth-user=alper@alper.com
set smtp-auth-password=alper123
set ssl-verify=ignore
set nss-config-dir=/etc/pki/nssdb/
set smtp-use-starttls
set from="alper@alper.com(Alper Ozsoyler)"

-> Try to send an email to yourself
# echo "Your message is my message!" | email -v -s "Message Subject is Bla Bla" alper@alper.com

Ref: https://gist.github.com/ilkereroglu/aa6c868153d1c5d57cd8