I cannot send emails more than 5 in php


#41

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


#42

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

after:

less than or equal to 5 sended successfullly


#43

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


#44

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?


#45

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!


#46

In what circumstances your code returns this?

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


#47

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

yes!


#48

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.


#49

$sql = “select email from email”;

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


#50

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);
}

#51

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


#52

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


#53

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;
}

#54

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.


#55

but i can send 5 emails at once


#56

but i can send 5 emails at once

Oh, using the multiple recipients?..


#57

Oh, using the multiple recipients?..

yessss!!!


#58

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.


#59

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


#60

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