Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am making a forum website with email notifications. I need to test these email notifications locally. Ive only ever used MAMP so I dont have much experience setting up dev environments.

What's the easiest way to test Drupal's email notifications locally? Can the Acquia stack do this?

share|improve this question
up vote 9 down vote accepted

You can log the emails, which also brings some sanity to your inbox. Of cause there is a module for that (or two):

share|improve this answer
    
Thats a nice way round. Ideally id prefere emails to be sent but yourse is a close 2nd choice. Thanks – Evans Feb 14 '12 at 15:52
    
drupal.org/project/reroute_email is another module that will send the emails to a configured address rather than logging them. – gapple Feb 15 '12 at 0:21

Try out Antix. It's easy to set up and works well to test out on a local Drupal install.

share|improve this answer

A bunch of solutions is documented in the Drupal Community Documentation: Managing Mail Handling for Development or Testing.

Personally I prefer a combination of a local Postfix mail server, the Reroute Email module, and rerouting to a local mailbox. This has the advantage that you don't have to go through the trouble of setting up your local host to successfully send to external e-mail addresses without being rejected as a possible spammer. How to set it up:

  1. Install postfix. The default configuration under Ubuntu will work for our purposes.
  2. Make sure your relevant php.ini is set up to use postfix by containing these two lines. Contrary to the comments there, these settings are not just used on Win32 systems.

    SMTP = localhost
    smtp_port = 25
    
  3. Install the Reroute Email module: drush dl reroute_email && drush en reroute-email.

  4. In the configuration settings for Reroute Email, set the target addres to your Linux username (such as matt, no @hostname.tld part here). These e-mails arrive in your local mailbox in /var/spool/ then.
  5. Set up Thunderbird to fetch these e-mails: Go to "Edit → Account Settings → Add Other Account… → Type: Unix Mailspool (Movemail)" and use these settings:
    • "E-Mail Address": again use your Linux username (such as matt) but determine your hostname (hostname command) and add it hostname behind in the format username@hostname.
    • "Your Name" and "Account Name": anything will work, this is just cosmetics.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.