Email notification on posting in phpBB forum

Posted on 2005-05-06
Last Modified: 2008-03-17
hi all!

here's the deal : i want to notify my few member of my PHPBB forum by sending them an email evrytime someone send a post or a reply.

to do so i was thinking i could simply add some code in the PHPBB code.
there is a php page wich is use to send the post and when it submit the information i would add my code when its a new post and when its a reply. I can simply do a querry in the PHPBB database in the USERS_TABLE and take all the email adress... thats the easy part...

but then i need to send the emails....i could do a loop that go through my querry and send the email to each one but i dont know how to send the email....

so what do you guys think? is it possible? and if it is how to send email in PHP...

thanks for your help!
Question by:Dayus

    Accepted Solution

    i don't know what would be the table structure for php bb... but it should be something like this

    function send_html_mail($mail)
        $mail['to_address'] = $mail['to_name'] . ' <' . $mail['to_address'] . '>';
        $headers = 'From: ' . $mail['from_name'] . ' <' . $mail['from_address'] . ">\r\n";
        $headers .= 'Reply-To: <' . $mail['from_address'] . ">\r\n";
        $headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";

        mail($mail['to_address'], $mail['subject'], $mail['message'], $headers);
        return true;
            $sql = mysql_query("SELECT * FROM `PHPBB_USER;");
            $row = mysql_fetch_array($sql);
            $msg = "bla bla bal bla bla bla bla bla"; //what you want the message to be

            $mail['from_name']="YOUR NAME";
            $mail['subject']="NEW POST NOTIFICATION";
            $mail['to_name']=$row[firstname]." ".$row[lastname];

    LVL 10

    Expert Comment

    phpBB already handles people being able to watch topics for new posts. Users can click a link in a topic to be sent an email when a new post is made.

    If you want to alter the logic of when people are sent emails, you can change the user_notification function starting at line 574 of /includes/functions_post.php (in my version of phpBB anyway)

    If you can give us some idea of how you want to handle the notification, wecan maybe help you put something together


    Author Comment

    Well i you see we are only a small group of people using the forum its more for personnal purpose and its not open to public. the thing is we have to check the forum on a daily basis but no one is doing that so instead i want to do a email notification that will tell everyone that there is a new post or reply in the forum and possibly tell them where is the post/reply...
    so each time someone write a post/reply it send an email to evryone to tell them and so they'll know and go take a look on the post/reply

    there i hope it clarify a little what i'm hoping to do :)

    Edyonline i might try your stuff it might just be what im looking for im gonna try it as soon as possible and keek you updated about it


    Author Comment

    its almost working the way Edyonline told me to do

    only thing is that when you send a email to a group you need to separate them with a ",' wich is not present in this case so its trying to send to many adresse at the same view as one big adress...

    so i think we should do a loop adding every adress one by one adding the coma in between each....
    right? so it should be a text variable in wich we add some more text every loop...

    im gonna try to do that

    if you have any better idea im all open!

    if my thinigny work ill close the topic and give you some point Edyonline


    Featured Post

    Easy Project Management (No User Manual Required)

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    This is a general how to create your own custom plugin system for your PHP application that you designed (or wish to extend a third party program to have plugin functionality that doesn't have it yet).  This is not how to make plugins for existing s…
    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    The viewer will learn how to dynamically set the form action using jQuery.
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now