Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/12/2005, 12:21
tamahome
Usuario no validado
 
Fecha de Ingreso: agosto-2004
Mensajes: 74
Antigüedad: 19 años, 8 meses
Puntos: 0
envio con PHPMailer adjuntos segun opcion

Mi consulta es la siguiente, estoy utilizando PHPMailer smtp para el envio de mail a traves de un formulario. puedo enviar un archivo adjunto que esta en una carpeta del servidor sin problema, incluyendo en el codigo php

Código PHP:
$mail->AddAttachment(documentos/archivo.pdf); 
lo que me gustaria hacer es que a traves del formulario, pudiera seleccionar con casillas de verificacion el archivo a adjuntar en cada envio y tambien poder enviar mas de uno si lo creyese conveniente.

la verdad es que no se como hacerlo, imagino que con

Código PHP:
if ($info1==ON)  {
     
$mail->AddAttachment(documentos/archivo.pdf);

pero no me funciona. alguien me puede ayudar?

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">&nbsp;</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">&nbsp;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">&nbsp;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">&nbsp;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">&nbsp;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">
                            &nbsp;Información 5 </font></b></td>
                        </tr>
                        <tr>
                            <td height="22" align="center" width="25">
                            <p style="margin-top: 1px; margin-bottom: 1px">&nbsp;</td>
                            <td height="22" width="253">
                            <p style="margin-top: 1px; margin-bottom: 1px"><b>
                            <font size="1" face="Verdana" color="#666666">&nbsp;</font></b></td>
                        </tr>
                    </table>
                </div>
                <p align="center" style="margin-top: 1px; margin-bottom: 1px">
                <input type="submit" value="Enviar" name="enviar">&nbsp;&nbsp;
                <input type="reset" value="Restablecer" name="borrar"></p>
            </form>