Sending emails from your Ubuntu Drupal development environment in 2 minutes

By shane
Sat, 2012-07-28 22:56
3 comments

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/

Need to learn more Drupal?

Premium Drupal Training Online (Horizontal)

Comments

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).

Post new comment