Using Gmail ID for sending Emails in Centos

Long story in short. 

Follow below steps.

1. Install "ssmtp" package in Centos.

yum install ssmtp

2. Now open /etc/ssmtp/ssmtp.conf file and change below mentioned details.

mailhub=smtp.gmail.com:587
Hostname=host@example.com #not sure if this really matters
FromLineOverride=YES
UseSTARTTLS=YES
AuthUser=test@gmail.com
AuthPass=Th!sP@ssword!
TLS_CA_File=/etc/pki/tls/certs/ca-bundle.crt

3. Now open "/etc/ssmtp/revaliases" file and add below line.

root:test@gmail.com:smtp.gmail.com:587

4. Now run alternatives command and select sendmail.ssmtp as a default mta

alternatives --config mta

5. Now you can test mail using mutt.

No comments:

Post a Comment