Jump to content


Photo

Easy Problem


  • Please log in to reply
1 reply to this topic

#1 Loons

Loons
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 14 March 2006 - 04:28 PM

<form method="post" action="mail.php?send=1">
<input type="text" name="subject" value="Subject goes here" /><br />
<textarea name="body">Message goes here</textarea><br />
<input type="submit" value="Send" />
</form>
<pre>
<?PHP
    if($_GET['send'] == 1)
    {
        $from = 'from@address.here';                 
        $sendto = array(    'address@one.com',
                            'address@two.com',
                            'address@three.com');    
        foreach($sendto as $val)
        {
            echo 'Sending message to: '.$val.' <br />';
            mail($val, $_POST['subject'], $_POST['body'], 'From: '.$from);
        }
    }
?>
</pre>

i'm working on a project for school and I can't get this damn thing to work, I want to send 1 e-mail to like 150 people, but this is all i could get and it doesn't work - could someone please explain it to me or help me fix it?

#2 shortj75

shortj75
  • Members
  • PipPipPip
  • Advanced Member
  • 118 posts
  • LocationPort Huron,mi

Posted 14 March 2006 - 05:29 PM

try this
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<form method="post" action="mail.php">
<input type="text" name="subject" value="Subject goes here" /><br />
<textarea name="body">Message goes here</textarea><br />
<input type="submit" name="send" value="Send" />
</form>
<pre>
<?PHP
if($_GET['send'] == true)
{
$from = "from@address.here";
$subject = $_POST['subject'];
$sendto ="address@one.com, address@two.com,address@three.com";
$messege="$_POST[body] r/n
Sending message to: $sendto r/n";
mail($sendto, $subject, $message, From: $from);
}

?>
</pre>
[/quote]
hopfully this helps
The Short One

hopfully this helps if it doesn't sorry
i won't write the code for you!!! you don't learn that way




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users