Results 1 to 8 of 8

Thread: Simple Mailing List

  1. #1
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default Simple Mailing List

    1) CODE TITLE: Simple Mailing List

    2) AUTHOR NAME/NOTES: Chris Macdonald/ Nile's assistance

    3) DESCRIPTION: A simple mailing list uses a text file and php files. User's can add email addresses to receive emails and can remove them from the list. The admin is the only one that can send the messages (modify access.php with username and password in $username=="" and $password=="'). Make sure to change the permissions of addresses.txt to 777 so the addresses can be added and removed by the users.

    ATTACHED BELOW

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Nice script.
    1 thing though, usually when you send a mailing list, you put all the emails in BCC, that way some can't see everybody elses email that's on the mailing list.
    Jeremy | jfein.net

  3. #3
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Okay I'll update this in a bit with that and I forgot to check if the email address was relatively valid (containing . & @). If anyone else can think of anything I should add in let me know.

  4. #4
    Join Date
    Dec 2008
    Location
    Nigeria
    Posts
    95
    Thanks
    3
    Thanked 8 Times in 8 Posts

    Default

    That was nice and easy to configure. How about adding an ajax interface to it?

  5. #5
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Everything you do diltony is with ajax!! Lol. What if they have it disabled?
    Jeremy | jfein.net

  6. #6
    Join Date
    Dec 2008
    Location
    Nigeria
    Posts
    95
    Thanks
    3
    Thanked 8 Times in 8 Posts

    Default

    I can always revert back to

    <script src="ajax.class.js"></script>
    <noajax>
    <script language="html">alert("YOU MUST ENABLE AJAX TO VIEW THIS PAGE NOW!!!!!");</script>
    </noajax>

    Crazy isnt it, fortunately most browsers support DHTML now though, google have promoted it, and so we now have ajax chat, ajax this, ajax that.......lol..........i just enjoy scripting and especially enjoy ajax, creating classes.....i have known ajax since the very begining, just that most browsers do not support it then, so i had to wait......
    anyway, ajax or no ajax, the mailing list script is nice.
    Maybe i should start posting php codes then. i am yet to post one yet, all i have been doing was posting ajax as if ajax is all there is to DHTML!!
    Last edited by diltony; 12-30-2008 at 11:31 PM.

  7. #7
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Okay this newer version Bcc's all contacts, verifys email address is valid, verify's the email address entered was removed from the mailing list, and allows for you to enter in your from data in the address.php file.

  8. #8
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Okay found one more bug with this. If a robot hits the page it will send out a blank email to all users by triggering the mail action. To solve this you could a) attempt to block all robots and hope a user never try's the address or b) user this code below. This is the whole code not just the part I added however if you do just want those lines its 22-27.

    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    </head>

    <body>
    <?php
    // Simple Mailing List//
    //CODE COMPILED BY CHRIS MACDONALD http://www.christophermacdonald.net //
    $message $_POST['message'];
    $myfile "addresses.txt";
    $fh fopen($myfile'r');
    $thedata fread($fh20000000);
    fclose($fh);
    $to '';
    $subject 'Subject test';
    $headers  'MIME-Version: 1.0' "\r\n"
    $header .= "From: youremailaddressgoeshere@yourdomain.com" "\r\n";
    $header .= $thedata "\r\n";
    if (
    $message == "") {
    die (
    "Please go back and enter your message</body></html>");
    }
    else {
    mail($to$subject$message$header);
    }
    echo 
    'Mail Sent';
    ?>
    </body>
    </html>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •