Topic: need method to test php_mail function independent of punbb

I have just installed Punbb 1.2.1 and am very impressed !

I am using on Windows 2000/IIS 5 server.

In testing, new users are not receiving registration confirmation emails.  I do not have any SMTP information filled out on the config page, based on recommendations found in this forum.  Therefore, I assume I am relying on the php_mail function, or some email functionality native to php.

Is there a way to test the PHP email functionality independent of punbb, maybe with a simple script snippet?  Bear in mind, I really know nothing about PHP other than what I needed to know to install it for PunBB.

I am my own host provider, so if this functionality is disabled, it's not intentional ! 

Any help or commentary would be appreciated.

2 (edited by elbekko 2006-04-03 20:28)

Re: need method to test php_mail function independent of punbb

make a new page and send a test mail from there smile

EDIT:
Use this code to make a new page:

<?php
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';

$page_title = pun_htmlspecialchars($pun_config['o_board_title']);
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
?>

<div id="divid" class="blocktable">
    <h2><span><?php echo $pun_config['o_board_title'] ?></span></h2>
    <div class="box">
        <div class="inbox">
        
        </div>
    </div>
</div>

<?php
$footer_style = 'index';
require PUN_ROOT.'footer.php';
?>

Re: need method to test php_mail function independent of punbb

If you haven't filled out any SMTP info in admin/options, PunBB uses PHP's mail() function (which in turn relies on your local SMTP service). Here's a small PHP test script:

<?php

if (mail('foo@bar.com', 'The subject', 'The message'))
    echo 'Mail sent';
else
    echo 'Something is br0ken';

?>
"Programming is like sex: one mistake and you have to support it for the rest of your life."