[development] setting mail server for development

Gábor Hojtsy gabor at hojtsy.hu
Sun Dec 16 13:19:13 UTC 2007

On Dec 16, 2007 12:54 PM, Augustin (Beginner)
<drupal.beginner at wechange.org> wrote:
> Recently, I was trying to debug a patch for devel_issues.module: the
> problem was with the formatting of the mail notification. I had
> troubles working efficiently on that patch because my development
> platform is not configured to send mails (to myself!).
> How do you handle such issues?

A tip: Drupal can use an arbitrary mail backend. Look into
http://api.drupal.org/api/function/drupal_mail_send/6 (in Drupal 6) or
http://api.drupal.org/api/function/drupal_mail/5 (in Drupal 5). You
can set the smtp_library variable to a file name, which Drupal will
include and "send mail" with a drupal_mail_wrapper() function defined
in that file. There you can log the mail to the database, a file or
whatever. So all mail going out from Drupal can be nicely debugged
locally. If you really need to send the mail over some server, as the
name of the variable suggest, you can use an SMTP library and use any
SMTP server you use otherwise to send mail, though I didn't have
problems I solved this way though.


More information about the development mailing list