SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    235
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php send mail problem

    hi everyone
    i have a form and when i press submit , i want to send mail to 2000 user at the same time .. the problem is that the server does not send over 200 mail at the same time..
    so the rest (1800 ) could not be sent

    i want to send the 2000 mail and to be sure that it is sent correctly.
    does anyone have an idea to solve this problem???

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2009
    Location
    Austria
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    200 recipients in BCC
    and execute mail-function in a loop until 2000 emails are sent
    ??

  3. #3
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    235
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by blubb View Post
    200 recipients in BCC
    and execute mail-function in a loop until 2000 emails are sent
    ??
    do u mean , that i have to make a loop from 1 to 2000 record
    i will select mail from database where flag=0,
    i will made a
    PHP Code:
    sleep(/* for a long time*/
    at the end of the loop, and changing flag from database to 1
    after that i will send after the sleep the mails that its flag = 0 (which are not transfered from zero to one)

    but i think that sleep cannot work inside a loop.

    do u have any other idea?

  4. #4
    SitePoint Enthusiast
    Join Date
    May 2009
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes you have to make a loop ,do one thing when you submit the form check in your database that how many email are there to whom you want to send email.

    PHP Code:
    $sql="select * from table name where flag=0";
    $query=mysql_query($sql) or die(mysql_error());
    $num_rows=mysql_num_rows($query);

    if(
    $num_rows>0)
    for(
    $i=0;$i<=$num_rows;$i++){
    send mail from here
    }

    If you have any diff then do let me know.

    Noddy

  5. #5
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    235
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vaibhavcoder View Post
    yes you have to make a loop ,do one thing when you submit the form check in your database that how many email are there to whom you want to send email.

    PHP Code:
    $sql="select * from table name where flag=0";
    $query=mysql_query($sql) or die(mysql_error());
    $num_rows=mysql_num_rows($query);

    if(
    $num_rows>0)
    for(
    $i=0;$i<=$num_rows;$i++){
    send mail from here
    }

    If you have any diff then do let me know.

    Noddy
    look i have 2000 mail that i have to send..
    the server sends only 200 at a time so i have to wait to send the other 200 untill i reach the 2000

    so i want to send the 2000 (200 per time so i have to send it 10 times in flags =0)
    my problem is on sleep, also when i close the borwser the mails will be sent or not??????
    may be when i close browser or open any other pages the send function will be rejected
    any idea

  6. #6
    SitePoint Evangelist
    Join Date
    Aug 2005
    Location
    Winnipeg
    Posts
    498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You'd best use a third party SMTP service like SMTP.com or more flexible still AuthSmtp.com.

    The latter of which I have used many times without issue:

    http://www.authsmtp.com

    Cheers,
    Alex
    The only constant in software is change itself


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
  •