Jump to content

Recommended Posts

Something is going wrong with my for statement
im not sure what it is but when i send and email to my self to test it
it sends 100's but what i want it to do is jus get the number that was put into the text box
and then send that number of emails
the name of the text box is "number"

below is the php script for the emailer

<?php
$to = "$email";
$subject = "$idea";
$from_header = "From: $from";




for ($i = $number; $i >= 1 ; $i++) {
mail($to, $subject, $contents, $from_header);
}
?>

can any one help me please
Link to comment
https://forums.phpfreaks.com/topic/10189-problem-with-emailer/
Share on other sites

I'm about 99% sure I closed another thread like this. Emailing the same person x amount of times is nothing but a spam/joke generator and won't be tolerated on these forums. Unless you can PM me with a valid reason for a tool like this, the thread will remain closed.

EDIT: Reopened.

Unless you're using an old version of PHP, you need to use $_POST['number'] or $_GET['number']... same goes with the name, email address, etc.

Also, your for loop is setup backwards. The middle term needs to be <=, it's a conditional statement that says keep going until it reaches x.
Link to comment
https://forums.phpfreaks.com/topic/10189-problem-with-emailer/#findComment-37972
Share on other sites

[!--quoteo(post=376059:date=May 22 2006, 11:36 AM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ May 22 2006, 11:36 AM) [snapback]376059[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I'm about 99% sure I closed another thread like this. Emailing the same person x amount of times is nothing but a spam/joke generator and won't be tolerated on these forums. Unless you can PM me with a valid reason for a tool like this, the thread will remain closed.

EDIT: Reopened.

Unless you're using an old version of PHP, you need to use $_POST['number'] or $_GET['number']... same goes with the name, email address, etc.

Also, your for loop is setup backwards. The middle term needs to be <=, it's a conditional statement that says keep going until it reaches x.
[/quote]

Thank you very much
Link to comment
https://forums.phpfreaks.com/topic/10189-problem-with-emailer/#findComment-37976
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.