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.

Disable Email notification in Magento Test Environment

After a long time I got something to post in this blog. Today I was setting up test magento instance and I took replica of the production system and installed and configured in my local VirtualMachine. My intention was to do some load testing and some RnD on test magento instance. But as I have Production data in my test machine, I thought to disable all email notification, so that in any case no email should be fired from my test machine.

So below steps I followed to stop mail functionality in magento.

1. You need to login into magento admin panel. In the admin panel go to "System" => "Configuration" => "System" and then in "Disable Email Communications" select "Yes". Then click on "Save Config" button on upper right side in Admin panel to save changes.


2. I had configured AWS SES for Email notification so I used another module called "SMTP Pro". So again go to "System" => "Configuration" => "SMTP Pro". Now in "Email Connection" select "Disabled" and save config.

3. Third option, I thought to turn off from the Server it self. To be at safer side, its good to disable local smtp. I used below command to turn off SMTP in my server.

/etc/init.d/postfix stop
chkconfig postfix off

I don't think anything else we can do to turn off Email Notification.