PHP Classes

File: tests/post_test_echomail.php

Recommend this page to a friend!
  Packages of Matthew Asham   Binkterm PHP   tests/post_test_echomail.php   Download  
File: tests/post_test_echomail.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Binkterm PHP
Bulletin board system based on the Web
Author: By
Last change:
Date: 6 days ago
Size: 895 bytes
 

Contents

Class file image Download
<?php

require_once __DIR__ . '/../vendor/autoload.php';

use
BinktermPHP\MessageHandler;
use
BinktermPHP\Database;

// Initialize database
Database::getInstance();

$messageHandler = new MessageHandler();

// Post a test echomail message
try {
    echo
"Posting test echomail message...\n";
   
   
$result = $messageHandler->postEchomail(
       
1, // fromUserId (assuming user ID 1 exists)
       
'LOCALTEST', // echoareaTag
       
'All', // toName
       
'Debug Test', // subject
       
'This is a test message to debug echomail formatting.' // messageText
   
);
   
    if (
$result) {
        echo
"? Echomail posted successfully\n";
    } else {
        echo
"? Failed to post echomail\n";
    }
   
} catch (
Exception $e) {
    echo
"Error: " . $e->getMessage() . "\n";
}

echo
"Check the error logs for debug information.\n";