Jump to content

Liam-a-

Members
  • Posts

    24
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Liam-a-'s Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Line 83: if (mail($emails[$i], $_POST['subject'], $msg, "From: Your Site<newsletter@yoursite.com>")) Line 87: echo "Mail $i failed<br>To: ".$emails[$i].'<br>'; New error PHP Notice: Undefined offset: 3 in Email.php on line 83 PHP Warning: mail(): SMTP server response: 503 Bad sequence of commands. You must specify the recipients of a message before you can send it in Email.php on line 83 PHP Notice: Undefined offset: 3 in Email.php on line 87 Don't no what these errors mean
  2. Can anyone help? am getting a error its about Function mail() PHP Warning: mail(): SMTP server response: 503 Bad sequence of commands. You must specify the recipients of a message before you can send it in Line 30: mail($emails[$i], $_POST['subject'], $msg, "From: Your Site<newsletter@yoursite.com>"); Now when ive been on the php website people say mail is the correct function to use, now my windows server rejects this.. can anyone help me out with a function that will send mail and also work on windows server. Thanks
  3. Line 30: mail($emails[$i], $_POST['subject'], $msg, "From: Your Site<newsletter@yoursite.com>");
  4. Ive found a new error on Line 30. PHP Warning: mail(): SMTP server response: 503 Bad sequence of commands. You must specify the recipients of a message before you can send it in
  5. Just alot of sites when they send out there spam mail it comes to inbox :/ not spam
  6. Also is there a PHP Email header you can add so it wont go to SPAM box?
  7. Hello, I currently have this script, its sending emails perfect but am getting a Error-500: Internal server error. after i press the submit button. its strange how i get this error but the mail still sends, ive tried for days to stop the error can anyone on here help me get rid of the error and help me to be able to send this message in HTML as I want to add images. well i would like to create the HTML email body within the code if anyone can point me in the right direction please. <?php //db connection mysql_connect($db_host,$db_username,$db_password) or die(mysql_error()); mysql_select_db($db_name) or die(mysql_error()); if(isset($_POST['submit'])) { //set emails as array $emails = array(); $x = 1; //quantity of emails sent before 3 sec delay to avoid timeout $hold = 99; //query to select the email address $sql = mysql_query("SELECT email_address FROM tblusers") or die(mysql_error()); //fetch them while($r = mysql_fetch_array($sql)) { $emails[] = $r['email']; } //count total emails $total = count($emails); //repeat for each email for ($i = 1; $i <= $total; $i++) { //stripslashes in message $msg = stripslashes($_POST['msg']); //send email to user (need to change name and email:) mail($emails[$i], $_POST['subject'], $msg, "From: Your Site<newsletter@yoursite.com>"); //if $x = 10 then wait 3 seconds to avoid timeout $x++; if($x == $hold) { sleep(3); $x = 0; } } //close database connection and echo success message mysql_close(); echo "<strong>Mail successfully sent to $total addresses!</strong><br><br>"; } ?> <html> <head> <title>Send Mail</title> <body> <form name="mail" action="" method="post"> Subject: <input type="text" name="subject" size="40"><br> <textarea name="msg" cols="40" rows="8"></textarea><br> <input type="submit" name="submit" value="Send Email"> </form> </body> </html> Thanks
  8. Theres a funny thing with this code, i press submit and it goes straight to error 500 but still send out ALL emails . so if its only going to be me using this script im not fussed if it returns to a error page after but still does the job. Thanks.
  9. Already had that in still giving error 500
  10. When i press submit it gives me Error 500
  11. even putting this in "" still gives me a error and no emails sent
  12. mail($emails[$i], $subject, $msg, "From: Your Site<newsletter@yoursite.com>"); This line I changed $emails[$i] to my email, and it sent me emails fine, can anyone help me why this "$emails[$i]" is causing a 500 error. Thanks
  13. when i submit nothing happens, doesnt tell me how many are sent just click and refreshes page basicly
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.