RSS

Newsletter

The CodeKarate Newsletter is the best way for technical ninjas to keep their swords sharpened. Don't worry, we won't flood your inbox and your email address will always remain private.
Back to Top

Sending emails from your Ubuntu Drupal development environment in 2 minutes

I use an Ubuntu system when developing Drupal websites. When setting up a development environment in Ubuntu you may need to configure your local development environment to send emails. Here is how I configured my system in less than 2 minutes.

First thing I did was install SSMTP. This is incredibly easy in Ubuntu, just run the following from the terminal.


sudo apt-get install ssmtp

SSMTP will only allow you to send emails through another email system. You could use Gmail to send the email, however I prefer an email delivery service such as Sendgrid (used on all my production sites... and now my development sites). It makes setting up a server to send emails as painless as possible. You can sign up for a free account to try it out at https://sendgrid.com/user/signup

The next thing is to edit the SSMTP config file.


sudo vim /etc/ssmtp/ssmtp.conf

Now add the following configuration options at the bottom of the file (filling in the user name and password accordingly):


mailhub=smtp.sendgrid.net
FromLineOverride=YES
AuthUser=[SENDGRID-EMAIL]
AuthPass=[SENDGRID-PASSWORD]
AuthMethod=LOGIN

Note: If you want to use Gmail to send your emails, this link might help - http://www.nixtutor.com/linux/send-mail-with-gmail-and-ssmtp/

Discussions

1
colan (not verified)

SSMTP vs. MSMTP

What's the difference between SSMTP and MSMTP? I've been using the latter.

1-1
shane

Not sure

I have never used MSMTP, however from my quick research it appears to be able to do the same thing as SSMTP. My guess is there are probably some technical differences between what they can do, but at first glance it seems that both would work (although the setup would obviously be different).

shane's picture
1-2
colan (not verified)

MSMTP setup instructions

I've got some setup instructions for MSMTP over at Basic mail for your Drupal site with msmtp.

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h2> <h3> <blockquote> <img>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <css>, <html>, <php>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <mysql>, <python>, <ruby>. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.