Jump to content

Easy Problem


Loons

Recommended Posts

[code]
<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 = '[email protected]';                
        $sendto = array(    '[email protected]',
                            '[email protected]',
                            '[email protected]');    
        foreach($sendto as $val)
        {
            echo 'Sending message to: '.$val.' <br />';
            mail($val, $_POST['subject'], $_POST['body'], 'From: '.$from);
        }
    }
?>
</pre>
[/code]

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?
Link to comment
https://forums.phpfreaks.com/topic/4942-easy-problem/
Share on other sites

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 = "[email protected]";
$subject = $_POST['subject'];
$sendto ="[email protected], [email protected],[email protected]";
$messege="$_POST[body] r/n
Sending message to: $sendto r/n";
mail($sendto, $subject, $message, From: $from);
}

?>
</pre>
[/quote]
hopfully this helps
Link to comment
https://forums.phpfreaks.com/topic/4942-easy-problem/#findComment-17429
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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