你好,我有一个小问题,好吧我还是一个php和html的初学者。而且我还在努力学习。 我有这个脚本,它发送电子邮件到很多电子邮件,我也需要它发送附件,我该怎么做? 这是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>
这是发送电子邮件的PHP代码:
<?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";
}
?>
我需要在php脚本中添加什么才能发送附件。我一整天都在苦苦挣扎,而且我还没能找到解决方案 谢谢大家。