I cannot send emails more than 5 in php

i m really stuck with this i dont know whats happen here were the problem :confused:

this is whats happen when i inserted 6th email in the table

after:

less than or equal to 5 sended successfullly

i just recently open my website . you mean to say 000webhost give access to send 5 emails per hour cz i dont think so.
sir it might be problem with the server plz analyze

i just recently open my website . you mean to say 000webhost give access to send 5 emails per hour cz i dont think so.

I have told you already I have managed to sent 10 e-mail in bulk from both your websites.

Error please Try After Sometime

In what circumstances your code returns this?

In what circumstances your code returns this?

  1. $to = “$email_list”;
  1. $subject ="$subject";
  2. $header = “from:$first_name<$email>”;
    4.$message =" $text ";
    if were not supply stuff to these variables!

beside of these there is no circumstances is there only if true then do if false then not.
i just wrote simply if else statement!

In what circumstances your code returns this?

So, when your code does not return info from database?

1 Like

So, when your code does not return info from database?

yes!

This means:

  1. Your code is not querying the database properly

  2. You have reached MAX_UPDATES_PER_HOUR. This is why I asked you what is the website in question. So I can confirm my presumption.

$sql = “select email from email”;

which mean selected all data from email column in email named table
beside of this no query is used!

Actually, why don’t you send emails one by one to your emails, I mean

while(mysqli_fetch_array($sql){
  $to = $row['email'];
  $subject ="$subject";
  $header = "from:$first_name<$email>"; 
  $message =" $text ";
  mail($to,$subject,$message,$header);
}

i already told that still i not send more than 10 emails yet bcz i run this query at least 2 times

but this i not what i want! i want to send emails to all my recipients just click single button

That does the trick :slight_smile: , try it
If you want to check if it worked, try the following code:

while(mysqli_fetch_array($sql){
  $to = $row['email'];
  $subject ="$subject";
  $header = "from:$first_name<$email>"; 
  $message =" $text ";
if (mail($to, $subject, $message, $header)) {
      $output. = "<div class='alert alert-success alert-dismissable fade in'><a href='#' class='close' data-dismiss='alert' aria-label='close'>&times;</a>E-mail send succesfully on registered E-mail Addresses</div>";
    } else {
      $output. = '<div class="alert alert-dismissable fade in"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>Error! please Try After Sometime</div>';
    }
  }
}
if(isset($output)){
echo $output;
}
1 Like

but this i not what i want! i want to send emails to all my recipients just click single button

You can’t send e-mails all at once. ̶m̶a̶i̶l̶(̶)̶̶ ̶s̶e̶n̶d̶s̶ ̶o̶n̶l̶y̶ ̶o̶n̶e̶ ̶e̶-̶m̶a̶i̶l̶ ̶a̶t̶ ̶o̶n̶c̶e̶.̶  <— not true

What you need is a loop that could walk through all the e-mails, just like I suggested you before.

but i can send 5 emails at once

but i can send 5 emails at once

Oh, using the multiple recipients?..

Oh, using the multiple recipients?..

yessss!!!

Well, I’m blind… Seriously, I am. I an sorry for missing that.

Maybe the mailing servers are not configured to send more than 5 e-mails using multiple recipients. I have not tested your websites for that.

I thought you were using the looping method to send e-mails in bulk. Nevermind, use @ckhawand’s solution, as in concept I was suggesting the same, and apparently it is the only one which works.

2 Likes

whattttttttttttttt i just said u so many time ?.y u not said me earlier omg yr

I missed the fact that we can send e-mails with multiple recipients. :sweat:

1 Like