r1467: Adding a mailtest script for people who are having problems receiving emails...
authorRobert Sesek <rsesek@bluestatic.org>
Sat, 17 Mar 2007 15:42:08 +0000 (15:42 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sat, 17 Mar 2007 15:42:08 +0000 (15:42 +0000)
docs/mailtest.php [new file with mode: 0644]

diff --git a/docs/mailtest.php b/docs/mailtest.php
new file mode 100644 (file)
index 0000000..8efbbdd
--- /dev/null
@@ -0,0 +1,125 @@
+<?php
+/*=====================================================================*\
+|| ###################################################################
+|| # Bugdar [#]version[#]
+|| # Copyright ©2002-[#]year[#] Blue Static
+|| #
+|| # This program is free software; you can redistribute it and/or modify
+|| # it under the terms of the GNU General Public License as published by
+|| # the Free Software Foundation; version [#]gpl[#] of the License.
+|| #
+|| # This program is distributed in the hope that it will be useful, but
+|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+|| # more details.
+|| #
+|| # You should have received a copy of the GNU General Public License along
+|| # with this program; if not, write to the Free Software Foundation, Inc.,
+|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+|| ###################################################################
+\*=====================================================================*/
+
+// runs a few tests to make sure that mailing works
+// SVN $Id$
+
+if (!file_exists('./global.php'))
+{
+       chdir('../');
+}
+require_once('./global.php');
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+       <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+       <title>Bugdar: Mail Test</title>
+</head>
+<body>
+       
+       <h1>Mail Test</h1>
+       <p>This tool will run a few email tests to make sure that emailing works. Follow the instructions below.</p>
+       
+       <hr />
+
+<?php
+
+if (empty($bugsys->in['__submit__']))
+{
+?>
+
+       <h2>Email Addresses</h2>
+       <p><strong>Enter in the following email addresses for sending and receiving.</strong></p>
+       
+       <form action="mailtest.php" method="get" accept-charset="utf-8">
+               <p>Email address to <em>receieve</em> all tests: <input type="text" name="receive" value="" size="25" /></p>
+               <p>An email address that exists on the mail server that is <em>not</em> the one receiving the tests: <input type="text" name="sender" value="" size="25 /"></p>
+               <p><input type="submit" name="__submit__" value="Continue &rarr;"></p>
+       </form>
+
+<?php
+}
+else
+{
+       $text = "You have successfully received test %d of 4. This tests %s.
+
+###################################################################
+PHP: " . phpversion() . "
+Mail Test: " . '$Revision$' . "
+Sendmail (From): \"" . ini_get('sendmail_from') . "\"
+Sendmail (Path): \"" . ini_get('sendmail_path') . "\""; 
+       
+       $mail->setFromName('Bugdar Mailing Test');
+       $mail->setSubject('Email Tests');
+       
+       // normal Bugdar mailing
+       $mail->setBodyText(sprintf($text, 1, 'sending with the Bugdar-configured address'));
+       $mail->send($bugsys->in['receive']);
+       
+       // mail from the alternate address
+       $mail->setBodyText(sprintf($text, 2, 'sending from the address you specified that exists on the mail server'));
+       $mail->setFromAddress($bugsys->in['sender']);
+       $mail->send($bugsys->in['receive']);
+       
+       // mail from self
+       $mail->setBodyText(sprintf($text, 3, 'sending from the receiving address'));
+       $mail->setFromAddress($bugsys->in['receive']);
+       $mail->send($bugsys->in['receive']);
+       
+       // mail from non-existent
+       $mail->setBodyText(sprintf($text, 4, 'sending from a non-existent address'));
+       $mail->setFromAddress('bugdar-mail-test@bluestatic.org');
+       $mail->send($bugsys->in['receive']);
+       
+?>
+
+       <h2>Complete</h2>
+       <p>All the test emails were sent to <em><?= $bugsys->in['receive'] ?></em>. Please check that you received all 4 tests.</p>
+       
+<?php
+}
+
+?>
+
+<hr />
+
+<h2>Variables</h2>
+<p>
+       <div>PHP: <?= phpversion() ?></div>
+       <div>Mail Test: $Revision$</div>
+       <div>Sendmail (From): "<?= ini_get('sendmail_from') ?>"</div>
+       <div>Sendmail (Path): "<?= ini_get('sendmail_path') ?>"</div>
+</p>
+
+</body>
+</html>
+<?php
+
+/*=====================================================================*\
+|| ###################################################################
+|| # $HeadURL$
+|| # $Id$
+|| ###################################################################
+\*=====================================================================*/
+?>
\ No newline at end of file