hi..:) how are you all ?
i programmed mail script and it's working , but i have some problem
here is the source
PHP Code:
<?php
/**
* @author : wlt-php
* @copyright: 2012
*/
//mail(to ,title, msg, headers);
$EmaiL = $_POST['youremail'];
$title = $_POST['title'];
$impor = $_POST['impor'];
$tmsg = $_POST['textmsg'];
if(isset($_POST['do']) && $_POST['do'] == 'send'){
if(empty($EmaiL)){
echo "Please type E-mail";
}elseif(empty($tmsg)){
echo "Type Your Message ..!";
}else{
$to = "exampl@gmail.com";
$sub = $title;
$msg = $tmsg;
$headers ="MIMI-Version: 1.0 \r\n";
$headers .="From: $E-MaiL $title \r\n";
$headers .="Content-Type: text/html; charset=utf-8 \r\n";
$headers .="X-priority: 3 \r\n";
mail($to ,$title, $msg, $headers);
die("Message Sent");
}
}
?>
<form action="sendmail.php" method="POST" >
<table width="60" border="4" align="center">
<tr>
<td>E-mail</td>
<td><input type="text" name="youremail" size="40" /></td>
</tr>
<tr>
<td>Subject</td>
<td><input type="text" name="title" size="40" /></td>
</tr>
<tr>
<td>Message Box</td>
<td><textarea name="textmsg" rows="20" cols="30"></textarea></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Send" /></td>
</tr>
</table>
<input type="hidden" name="do" value="send" />
</form>
the problem:
1- if i want to send E-mail first i have to modify the script and change the email to the one whom i want to send ($to = "exampl@gmail.com";)
how to make it sending e-mail without editing the code ? means i want to use it directly
and second thing .. i want to make it send many emails at once
can someone help me please and correct it
thank you