Código PHP:
$mail->AddAttachment(documentos/archivo.pdf);
la verdad es que no se como hacerlo, imagino que con
Código PHP:
if ($info1==ON) {
$mail->AddAttachment(documentos/archivo.pdf);
}
mi formulario es el siguiente:
Código PHP:
<FORM ENCTYPE="multipart/form-data" METHOD="post" ACTION="<?=$PHP_SELF?>">
<div align="center">
<p style="margin-top: 1px; margin-bottom: 1px">
<font color="#FF0000" face="Verdana" size="2"><b>.:Envío de
Información</b></font></p>
<table border="0" height="241" bgcolor="#E6E6E6" id="table1" width="381" cellpadding="5">
<tr>
<td height="22" colspan="2" width="118">
<p style="margin-top: 1px; margin-bottom: 1px"><b>
<font size="1" face="Verdana" color="#666666">
Empresa</font></b></td>
<td height="22" width="253">
<p style="margin-top: 1px; margin-bottom: 1px">
<font size="1" face="Verdana" color="#666666">
<input type="text" name="empresa" size="35" style="font-size: 8pt; font-family: Verdana"></font></td>
</tr>
<tr>
<td height="19" colspan="2">
<p style="margin-top: 1px; margin-bottom: 1px"><b>
<font size="1" face="Verdana" color="#666666">Envió
Email a</font></b></td>
<td height="19" width="253">
<p style="margin-top: 1px; margin-bottom: 1px">
<font color="#666666">
<input type="text" name="email1" size="35" style="font-size: 8pt; font-family: Verdana"></font></td>
</tr>
<tr>
<td height="21" colspan="2">
<p style="margin-top: 1px; margin-bottom: 1px"><b>
<font face="Verdana" size="1" color="#666666">A la
atención de ...</font></b></td>
<td height="21" width="253">
<p style="margin-top: 1px; margin-bottom: 1px">
<input type="text" name="contacto" size="35" style="font-size: 8pt; font-family: Verdana"></td>
</tr>
<tr>
<td height="142" rowspan="6" width="89">
<p style="margin-top: 1px; margin-bottom: 1px"> </td>
<td height="22" align="center" width="25">
<p style="margin-top: 1px; margin-bottom: 1px">
<input type="checkbox" name="info1" value="ON"></td>
<td height="22" width="253">
<p style="margin-top: 1px; margin-bottom: 1px"><b>
<font size="1" face="Verdana" color="#666666"> Información
1</font></b></td>
</tr>
<tr>
<td height="22" align="center" width="25">
<p style="margin-top: 1px; margin-bottom: 1px">
<font face="Verdana" size="1" color="#666666">
<input type="checkbox" name="info2" value="ON" style="font-weight: 700"></font></td>
<td height="22" width="253">
<p style="margin-top: 1px; margin-bottom: 1px"><b>
<font size="1" face="Verdana" color="#666666"> Información
2</font></b></td>
</tr>
<tr>
<td height="22" align="center" width="25">
<p style="margin-top: 1px; margin-bottom: 1px">
<font face="Verdana" size="1" color="#666666">
<input type="checkbox" name="info3" value="ON" style="font-weight: 700"></font></td>
<td height="22" width="253">
<p style="margin-top: 1px; margin-bottom: 1px"><b>
<font size="1" face="Verdana" color="#666666"> Información
3</font></b></td>
</tr>
<tr>
<td height="22" align="center" width="25">
<p style="margin-top: 1px; margin-bottom: 1px">
<font face="Verdana" size="1" color="#666666">
<input type="checkbox" name="info4" value="ON" style="font-weight: 700"></font></td>
<td height="22" width="253">
<p style="margin-top: 1px; margin-bottom: 1px"><b>
<font size="1" face="Verdana" color="#666666"> Información
4</font></b></td>
</tr>
<tr>
<td height="22" align="center" width="25">
<p style="margin-top: 1px; margin-bottom: 1px">
<font face="Verdana" size="1" color="#666666">
<input type="checkbox" name="info5" value="ON" style="font-weight: 700"></font></td>
<td height="22" width="253">
<p style="margin-top: 1px; margin-bottom: 1px"><b>
<font size="1" face="Verdana" color="#666666">
Información 5 </font></b></td>
</tr>
<tr>
<td height="22" align="center" width="25">
<p style="margin-top: 1px; margin-bottom: 1px"> </td>
<td height="22" width="253">
<p style="margin-top: 1px; margin-bottom: 1px"><b>
<font size="1" face="Verdana" color="#666666"> </font></b></td>
</tr>
</table>
</div>
<p align="center" style="margin-top: 1px; margin-bottom: 1px">
<input type="submit" value="Enviar" name="enviar">
<input type="reset" value="Restablecer" name="borrar"></p>
</form>