note 91160 added to function.mail

From: Date: Wed, 27 May 2009 21:01:20 +0000
Subject: note 91160 added to function.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-156092@lists.php.net to get a copy of this message
<?php if($_POST[send]){ $to = $_POST['to']; $name = $_POST['name']; $subject = $_POST['subject']; $message = stripslashes(strip_tags($_POST['message'])); $emailfrom = $_POST['email']; $times = $_POST['times']; //if($to==null || $name==null || $subject==null || $message==null || $emailfrom==null || $times==null){ // echo 'Please fill all fields!'; //}else{ if(strpos($to, "@")==false || strpos($to, ".")==false || strpos($emailfrom, "@")==false || strpos($emailfrom, ".")==false){ echo 'Please enter valid E-mails!'; }else{ if(strval($times) < 0 || strval($times) > 1000){ echo 'You can not send more than 1000 emails, and can not send less than 0 emails!'; }else{ for($i=0;$i<=$times;$i++){ mail($to, $subject, $message, 'From: '.$name.' <'.$emailfrom.'>'); } echo 'E-Mail(s) sent to '.$to.'!'; } } //} }else{ echo '<form method="post"> <input type="text" name="to" value="to@email.com" size="50"><br> <input type="text" name="name" value="Your Name" size="50"><br> <input type="text" name="email" value="from@email.com" size="50"><br> <input type="text" name="times" value="10" size="50"><br> <textarea cols="50" rows="5" name="message">Message</textarea><br> <input type="submit" name="send" value="Send Message"> </form>'; } ?> ---- Server IP: 92.48.74.199 Probable Submitter: 82.42.42.158 ---- Manual Page -- http://www.php.net/manual/en/function.mail.php Edit -- https://master.php.net/note/edit/91160 Del: integrated -- https://master.php.net/note/delete/91160/integrated Del: useless -- https://master.php.net/note/delete/91160/useless Del: bad code -- https://master.php.net/note/delete/91160/bad+code Del: spam -- https://master.php.net/note/delete/91160/spam Del: non-english -- https://master.php.net/note/delete/91160/non-english Del: in docs -- https://master.php.net/note/delete/91160/in+docs Del: other reasons-- https://master.php.net/note/delete/91160 Reject -- https://master.php.net/note/reject/91160 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#156092) next »