perezf Posted May 22, 2006 Share Posted May 22, 2006 Something is going wrong with my for statementim 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 boxand then send that number of emailsthe 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 Quote Link to comment https://forums.phpfreaks.com/topic/10189-problem-with-emailer/ Share on other sites More sharing options...
ober Posted May 22, 2006 Share Posted May 22, 2006 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 Link to comment https://forums.phpfreaks.com/topic/10189-problem-with-emailer/#findComment-37972 Share on other sites More sharing options...
perezf Posted May 22, 2006 Author Share Posted May 22, 2006 [!--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 Quote Link to comment https://forums.phpfreaks.com/topic/10189-problem-with-emailer/#findComment-37976 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.