Help, send multiple mail.

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

    Help, send multiple mail.

    Helo coderz pls help me with the code to send mail to all my users at once... Email are stored in database. Thanx

    #2
    PHP Code:
    $hmms mysql_query("SELECT email FROM users");
    while (
    $hmm mysql_fetch_array($hmms))
    {
    $headers 'From: 'admin@yoursite.tdl' . "\r\n" .'Reply-Toadmin@yoursite.tdl' . "\r\n" .'X-MailerPHP/' . phpversion();
    mail($hmm['
    email'],"Some title, "Your text",$headers);

    Comment


      #3
      thanx man let me try this out and give you feedback...

      Comment


        #4
        something else its not working for me

        Comment


          #5
          Try this just check table names.

          PHP Code:
          $emails = array();
          $select mysql_query('SELECT `email` FROM `users`');
          while (
          $sel mysql_fetch_array($select)) {
              
          $emails[] = $sel[0];
          }
          foreach (
          $emails as $email) {
              
          $subject 'Subject...';
              
          $message 'Message...';
              
          $header 'MIME-Version: 1.0'.PHP_EOL;
              
          $header .= 'Content-type: text/html; charset=utf-8'.PHP_EOL;
              
          $header .= 'From: mailing@mail.com';
              
              @
          mail($email$subject$message$header);

          echo 
          'Sent!';

          <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

          Comment


            #6
            t anx man. it works

            Comment


              #7
              im usin mobile plz share in zip

              Comment


                #8
                Here you go.
                Attached Files
                <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

                Comment

                Working...
                X