0

Hello I have a slight problem, well the thing is that I'm still a beginner with php and html.. And I'm still trying thing out to learn. I have this script right here that sends emails to a lot of emails and I need it to send attachments too, how can I do that ? This is the html :

 <td align="right" height="17" style="color: #000">
        <span class="texto">Reply to :</span></td>
        <td width="65%" height="17" style="color: #000">
        <input name="replyto" type="text" class="form" id="realname0" style="width:48%" value="<?php print $replyto; ?>" size="1" > 
    <font size="-3" face="Verdana, Arial, Helvetica, sans-serif">
      <input type="file" name="file" size="11" /></font></td>
      </tr>
      <tr>
        <td align="right" height="17"><span class="texto">subject:</span></td>
        <td height="17">
        <input name="subject" type="text" class="form" id="subject" style="width:100%" value="<? print $subject; ?>" size="1" ></td>
      </tr>

And this is the php code that sends the emails :

<?php
$testa = $_POST['veio'];
if($testa != "") {
$message = $_POST['message'];
$subject = $_POST['subject'];
$realname = $_POST['realname'];
$from = $_POST['from'];
$to = $_POST['emaillist'];
$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$email = explode("\n", $to);
$headers .= "From: ".$realname." <".$from.">\r\n";
$message = stripslashes($message);
$i = 0;
$count = 1;
while($email[$i]) {
$ok = "ok";
if(mail($email[$i], $subject, $message, $headers))
echo "* N?mero: $count <b>".$email[$i]."</b> <font color=green>OK</font><br> 
<hr>";
else
echo "* N?mero: $count <b>".$email[$i]."</b> <font color=red>ERRO AO 
ENVIAR</font><br><hr>";
$i++;
$count++;
}
$count--;
if($ok == "ok")
echo "FINALIZO SUPERGERADOR";
}
?>

What do I have to add in the php script so that it becomes able to send attachments. I've been struggling with this all day and I haven't been able to find a solution Thanks everyone.

0 Answers0