Skip to content

Instantly share code, notes, and snippets.

@thefonso
Last active June 10, 2017 08:12
Show Gist options
  • Select an option

  • Save thefonso/1eb8a87f3d587e826729f5958df23964 to your computer and use it in GitHub Desktop.

Select an option

Save thefonso/1eb8a87f3d587e826729f5958df23964 to your computer and use it in GitHub Desktop.
Install and configure Sendmail on Ubuntu 14.04

Install and configure Sendmail on Ubuntu

This should help you get Sendmail installed with basic configuration on Ubuntu.

  1. If sendmail isn't installed, install it: sudo apt-get install sendmail
  2. Configure /etc/hosts file: nano /etc/hosts
  3. Make sure the line looks like this: 127.0.0.1 localhost yourhostname
  4. Run Sendmail's config and answer 'Y' to everything: sudo sendmailconfig
  5. Restart apache sudo service apache2 restart
  6. $ echo "Subject: sendmail test" | sendmail -v SOMETHING@SOMEMAIL.COM

RAILS - Sending via Local Sendmail:

If you want to send the e-mails in the traditional way via local sendmail, then you need to insert the following lines into your configuration file config/environments/development.rb (for the development environment) or config/environments/production.rb (for your production environment):

config.action_mailer.delivery_method = :sendmail
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment