Mailx using Gmail SMTP

If You want to send mail with mailx command using Gmail SMTP server, here's working configuration.

In Your home folder create .mailrc file (e.g., /home/kate/.mailrc) containing:

 

set smtp-use-starttls
set nss-config-dir=/etc/ssl/certs
set ssl-verify=ignore
set smtp=smtp://smtp.gmail.com:587
set smtp-auth=login
set smtp-auth-user=YOUR_USERNAME@gmail.com
set smtp-auth-password=YOUR_PASSWORD
set from="YOUR_USERNAME@gmail.com(NICE_NAME)"

 

From now on "kate" would be sending her mail through Gmail SMTP.