Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 1999
    Location
    Canada, Toronto
    Posts
    103
    Rep Power
    16
    does anyone have any good ideas on what's the best way to write a simple mailing list program? If one tries to send email to over 600 addresses using mail(), a usual script will most likely timeout.

    So, the question is, what's the best way to sendout email to over 600 ppl?

    Thank you.


    ------------------
    Alex D. G.
    http://www.alexdg.com

  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    Seaside, CA
    Posts
    84
    Rep Power
    15
    You could go here:
    http://www.nameless.f2s.com/

    and grab a thing called Postlister. It works, and you can use any part of it. Here's what one of the "features" states:

    "No browser time-out. Some mailing list scripts attempt to send all messages at once, often causing the browser to time out before all messages have been sent. Postlister does not have that problem."

    I've used it on a site and haven't had any timeouts.

    ------------------
    From the day we're born, we're running out of time.
  4. #3
  5. No Profile Picture
    Robert_J_Sherman
    Guest
    Devshed Newbie (0 - 499 posts)
    I don't know how well this would work, but it's just an idea.. and maybe not a very good one.

    If you're "mail to's" are coming from a database, you could maybe configure your
    scripting via an ID# and a refresh loop..

    work it kinda like the "limit" statements work in mysql..

    that way your script only processes so many addresses, before the document refreshes, then it picks up the next group and processes to the next limit..

    etc..

    again, I don't know how viable an idea that is.. but it may be worth a thought.

    ------------------
    SnR Graphics,
    Low Cost Hosting and Web Development.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 1999
    Location
    Canada, Toronto
    Posts
    103
    Rep Power
    16
    JoelFord:

    interesting concept they've got there... using javascript for the main loop... very interesting. I think i'm going to use it if noone suggests better method =)

    Robert_J_Sherman:

    you are describing EXACT idea from the script JoelFord suggested =)

    ------------------
    Alex D. G.
    http://www.alexdg.com

  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    456
    Rep Power
    15
    I haven't really looked at it myself, but DevShed actually has a tutorial for a PHP mailing list:

    http://www.devshed.com/Server_Side/PHP/mailing/

    Ryan
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    4
    Rep Power
    0
    > interesting concept they've got there...

    Thank you! :-) (I am the author of Postlister).

    > using javascript for the main loop...

    Actually that wasn't my idea. I got the idea from a CGI script called RobMail ( http://robplanet.com ).

    I don't think the JavaScript loop is the ideal way to solve the problem - most of all because not all browsers support JavaScript. However, I couldn't find a better solution, and I kinda figured that if it was good enough for the guy who wrote RobMail, it was good enough for me.

    But still, if anyone can think of a better solution which uses PHP only, please post it here. I'm curious to see if it is actually possible.

    By the way, Postlister has now become an open source project, so if anyone is interested in developing Postlister, they should visit http://sourceforge.net/projects/postlister

    [This message has been edited by Jonas (edited July 18, 2000).]
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 1999
    Location
    Canada, Toronto
    Posts
    103
    Rep Power
    16
    well... you could use shell the same way as you used javascript... this way you won't see the progress in the browser... just an idea


    ------------------
    Alex D. G.
    http://www.alexdg.com

  14. #8
  15. No Profile Picture
    Robert_J_Sherman
    Guest
    Devshed Newbie (0 - 499 posts)
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by AlexDG:
    JoelFord:

    interesting concept they've got there... using javascript for the main loop... very interesting. I think i'm going to use it if noone suggests better method =)

    Robert_J_Sherman:

    you are describing EXACT idea from the script JoelFord suggested =)
    [/quote]

    Actually in mine, and I'm using this method, on our servers I found the system would timeout when doing the following:

    sending more than 25 emails at one time, or validating links at more than 50 at one time.

    I essentially did it like so, and no JS envolved.

    For email, I set a loop, with an SQL call to a LIMIT $pos,$limit

    $pos, starts at 0 and the $limit set from a config file, at 25.

    The system runs through the first 25, sends the "mail()" and then creates a "response" page, with a "status" (SENT, or ERROR).

    At the bottom is a new "hidden" form, with all the original "posted" values, and a button to "continue" the process.

    In those posted values in the new value for $pos.

    So the next db call starts at the pos. Since we're doing 25 at a time.

    it walks through this process until all the messages have been sent.

    Granted, it's not a "complete" automated process, but there are some pluses to this, frankly, many mail servers have things built in them to look for "spam" one of those is to either limit the number of messages sent at any one given time. This method avoids that by limiting how many are sent, since the $limit is set by a config file, the user/server can control things, if your server will let you shoot off 500 without a timeout, then there's your limit.. etc..

    Validating URLs is a similar process, just no need for a hidden form post, "if" your URLs are stored in a database.

    Granted, this method/idea really only works if your storing the information in a database or a flat file..

    but so far, I haven't had any problems with it.

    ON A SIDE NOTE:

    I never encountered this problem using Perl to send mail to a mailing list.. so I'm not sure if it's PHP that's the real problem, or if it's just how the host server has configured things...

    ------------------
    SnR Graphics,
    Low Cost Hosting and Web Development.

    [This message has been edited by Robert_J_Sherman (edited July 18, 2000).]
  16. #9
  17. No Profile Picture
    ledjon
    Guest
    Devshed Newbie (0 - 499 posts)
    These sort of back-end things are much better suited to perl/cgi. I consider PHP to be much more of a front-end/Databasa calling scripting language.
  18. #10
  19. No Profile Picture
    ledjon
    Guest
    Devshed Newbie (0 - 499 posts)
    Now that I've looked at Postlister I'm quite impressed. I still say CGI would have been a better choice, but this was very well done.
  20. #11
  21. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    4
    Rep Power
    0
    > At the bottom is a new "hidden" form, with > all the original "posted" values, and a
    > button to "continue" the process.

    And that's the problem. If you send out mail to 500 people, it would be annoying that you would have to push that button so many times.

    > I never encountered this problem using Perl > to send mail to a mailing list..

    What problem - the time-out problem? I can assure you it's there - even if you use Perl. Like I said, I got the JavaScript loop idea from RobMail, which is a Perl CGI script, so obviously the guy who wrote RobMail had encountered the same time-out problem and found a way to work around it using JavaScript.

    > so I'm not sure if it's PHP that's the real > problem

    PHP is not causing the problem as far as I can tell.
  22. #12
  23. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    26
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by scream:
    I haven't really looked at it myself, but DevShed actually has a tutorial for a PHP mailing list:

    http://www.devshed.com/Server_Side/PHP/mailing/

    Ryan
    [/quote]


    I have a host that supplies me with php3 services. I have basically placed all required files in my root directory. Plus added the data directory. But I seem to end up with some errors eg below:

    Warning: fopen("data/firstlist.lst","w") - Permission denied in (....my directory) saveemail.php3 on line 18

    - does this mean I have to set up permission on my directories?

    It seems to me that it can't write the email contents into the file.

    Regards

    Richard


  24. #13
  25. No Profile Picture
    ledjon
    Guest
    Devshed Newbie (0 - 499 posts)
    Yes, if you want to write to a new file you need to chmod the directory 777. If the file already exists, you should just need to chmod that file 777.. but to be sure, try chomeding both of them.
  26. #14
  27. No Profile Picture
    ads
    Guest
    Devshed Newbie (0 - 499 posts)
    Can't I write a simple php programme in which i will call mailto() function and pass whatever number of email addresses stored in mysql table by while loop. One by one programme will send mail to all address and complete the loop. Correct me if I am wrong.
  28. #15
  29. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 1999
    Location
    Canada, Toronto
    Posts
    103
    Rep Power
    16
    the script will time out if you have a lot of subscribers...

    ------------------
    Alex D. G.
    http://www.alexdg.com

Page 1 of 2 12 Last
  • Jump to page:

Similar Threads

  1. Replies: 2
    Last Post: August 18th, 2004, 11:45 PM
  2. help me with my mailing list please...
    By INE-Kpro... in forum HTML Programming
    Replies: 5
    Last Post: February 25th, 2004, 08:29 AM
  3. Listing a list alphabetically...?
    By vivi0198 in forum PHP Development
    Replies: 13
    Last Post: February 11th, 2004, 11:26 AM
  4. Another *almost* redundant mailing list question
    By Bob Ricci in forum PHP Development
    Replies: 12
    Last Post: January 27th, 2004, 04:18 AM
  5. PHP Mailing list Question
    By byte me in forum PHP Development
    Replies: 3
    Last Post: January 23rd, 2004, 07:55 AM

IMN logo majestic logo threadwatch logo seochat tools logo