selecting all emails from database and sending email

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    selecting all emails from database and sending email

    Hello friends can you please give me any script that selects all emails from your lava database and sends email to all users . Please help me with this script . Its very urgent i tried to code myself but none worked. Help me friends

    #2
    try 'spam message sender' idea or search 'multiple email' i think)
    http://ngeo.ro

    Comment


      #3
      i have this script which also sends email after selecting all emails from your database but its not working for me its showing response error . So please can you correct the code blackhawk mate
      <?php
      include("dbconnection.php");
      if (!isset($_POST[''submit''])):
      ?>
      <html>
      <head>
      <title>Mailing List</title>
      </head>
      <body>
      <form method="post" action="<?=$_SERVER
      [''PHP_SELF'']?>">
      <table align="center" bgcolor="#D6DEE7"
      border="0" cellpadding="0" cellspacing="0">
      <tr>
      <td align="center">
      <b><h2>MAILING LIST ADMIN</h2></b>
      Send message to:
      <select name="to" size="1" style="background-
      color: #F7F7F7">
      <option selected value="all">Entire list
      <option value="notall">By country
      </select>
      Country:
      <select name="country" size="5">
      <OPTION value="Argentina">Argentina
      <OPTION value="Bolivia">Bolivia
      <OPTION value="Brazil">Brazil
      <OPTION value="Chile">Chile
      <OPTION value="Colombia">Colombia
      <OPTION value="Costa Rica">Costa Rica
      <OPTION value="Ecuador">Ecuador
      <OPTION value="Guatemala">Guatemala
      <OPTION value="Honduras">Honduras
      <OPTION value="Mexico">Mexico
      <OPTION value="Nicaragua">Nicaragua
      <OPTION value="Panama">Panama
      <OPTION value="Paraguay">Paraguay
      <OPTION value="Peru">Peru
      <OPTION value="Puerto Rico">Puerto Rico
      <OPTION value="Rep. Dominicana">Rep.
      Dominicana
      <OPTION value="Uruguay">Uruguay
      <OPTION value="Venezuela">Venezuela
      </select>
      Title or Subject: <input name="subject" type=text
      maxlength=100 size=40>
      Message:
      <textarea wrap name="message" rows=10
      cols=45></textarea>
      <input type=submit name="submit"
      value="SUBMIT">
      </td>
      </tr>
      </table>
      </form>
      </body>
      </html>
      <?php else:
      $to = $_POST[''to''];
      $subject = $_POST[''subject''];
      $message = $_POST[''message''];
      $country = $_POST[''country''];
      if ("all" == $to) {
      $x = 1;
      $hold = 50; // quantity of emails sent before 3
      sec delay
      $emails = mysql_query("SELECT email FROM
      members");
      while ($sendemail = mysql_fetch_array
      ($emails)) {
      $email = $sendemail["email"];
      mail($email, $subject,
      $message, "From:Your name
      <you@whatever.com>");
      $x++;
      if($x == $hold) { // When $x is equal to $hold,
      a 3 sec delay will occur avoiding php to timeout
      sleep(3);
      $x = 0;
      }
      } // end of while loop
      } else {
      $bycountry = mysql_query("SELECT email
      FROM members WHERE country = ''$country''");
      while ($countmail = mysql_fetch_array
      ($bycountry)) {
      $email = $countmail["email"];
      $okemail = mail($email, $subject,
      $message, "From:Your name
      <you@whatever.com>");
      $x++;
      if($x == $hold) { // When $x is equal to $hold,
      a 3 sec delay will occur avoiding php to timeout
      sleep(3);
      $x = 0;
      }
      } // end of while loop
      }
      ?>
      <html>
      <head>
      </head>
      <body>
      SUCCESS!
      </body>
      </html>
      <?php endif; ?>

      Comment


        #4
        get some codes from the forgot password send to email



        then change your msql query to select all emails
        LDSWAPWORLD sigpic
        site closed.
        im busy with other things in life like facebook , send me PM so i can add you
        www.pinoySG.com

        don't ask for help if you're not even helping yourself!
        i am tired of seeing the line "best site", i want to see something NEW and UNIQUE. maybe if i find one, ill go back to my wap life again.


        Comment


          #5
          wow cool idea mate

          Comment


            #6
            well that idea is not going to work lol. Blackhawk mate please help me, i tried to spam code but that is giving unknown reply after uploading it

            Comment


              #7
              hello, i dnt know nthng about lava variables my snippet is just a idea about sending emails. you must adapt with your hands this or try to select emails with LIMIT 1 by status ON and deliver one by one(of corse insert status row on or of)
              http://ngeo.ro

              Comment


                #8
                so was that script was working for you without any error blackhawk mate because i am getting reply unknown.

                Comment


                  #9
                  here is my script can you please try to help what wrong with this script that i am getting unknown reply with this too mate
                  <?php
                  set_time_limit(0);
                  ignore_user_abort();
                  mysql_connect( "database hostname" ,
                  "username" , "*****" );
                  mysql_select_db( "...." );
                  echo ''Database connected...'';
                  $limit = 250; //however many emails you want
                  to send at a time
                  $pos = $_GET["pos"];
                  if(empty($pos)) {
                  $pos = 0;
                  }
                  if ($pos == 0) {
                  $sql = "SELECT email FROM users LIMIT 100";
                  } else {
                  $sql = "SELECT email FROM users LIMIT ";
                  $sql .= $pos;
                  $sql .= '', '';
                  $sql .= $limit;
                  }
                  $result = mysql_query($sql);
                  while($user = mysql_fetch_assoc($result)) {
                  $email = $user[''email''];
                  mail($email , "...." , $body , "...");
                  echo $email;
                  }
                  $pos =$pos + $limit;
                  echo ''<p><a href="''.$_SERVER[''PHP_SELF''].''?pos=''.
                  $pos.''">Send to the next ''. $limit .'' entries</a></
                  p>'';
                  ?>

                  Comment


                    #10
                    Thanks for the share
                    Last edited by spider; 06.10.09, 11:42.

                    Comment


                      #11
                      Originally posted by spider View Post
                      Thanks for the share
                      u said thanks. Have u tried it?
                      http://myfacepals.com
                      MYFACEPALS SOCIAL NETWORKsigpic

                      Comment


                        #12
                        you can' t send 50emails on each 3sec! that means 1000 per min?!
                        most common servers don' t accept more than 200 per min.
                        anyway if you want to send more than two you must respect the comma. ' ; ' ex: you@you.com; you@me.com; you@us.com; etc.
                        try to print the result first.
                        http://ngeo.ro

                        Comment


                          #13
                          This is pointless!! all its doing is sending spam mail, like blackhowk said most common servers don' t accept more than 200 per min. and imagine having about 10,000 members and sending emails to all, it will kill the server! i don't think any host will allow this on the servers.

                          Comment


                            #14
                            well i created my script for to use emails stored in database to send all of them emails , i have about 1800 emails stored so i sent them emails
                            And its worked for me

                            Comment

                            Working...
                            X