Skip to content

Using Mantis with a reduced mail() function

February 25, 2009

Mantis is a free web-based bug tracker. As most web trackers, it uses e-mail to notify testers and developers about the evolutions of issues they have reported or they just follow. For that purpose, Mantis uses Codeworx PHP Mailer class that gives you the opportunity to use the PHP mail() function, sendmail or a SMTP server to send those e-mails.

The use of the PHP mail() function is the default option. Unfortunately, some web hosting companies limits the PHP mail() function by forbidding the use of the 4th and 5th (optional) parameters. The result is that you can’t use the e-mail functionality of PHP mailer / Mantis because they use the 4th parameter.

The solution is to edit the file class.phpmailer.php in the directory mantis-dir/core/phpmailer/. Inside the file, look for the two lines containing the string “@mail” and replace the 4th argument by the e-mail address where the e-mail will be sent from. Example:

   $rt = @mail($to, $this->EncodeHeader($this->Subject), $body,
         "From: \"mybugs - Mantis bug tracker\" <me@domaine.tld>");
}
else
   $rt = @mail($to, $this->EncodeHeader($this->Subject), $body,
         "From: \"mybugs - Mantis bug tracker\" <me@domaine.tld>");

Now you have a fully functional bug tracker 🙂

From → Open Source

One Comment

Trackbacks & Pingbacks

  1. Using Mantis with a reduced mail() function | BH-Server

Comments are closed.

%d bloggers like this: