Recordad que para pedir soporte alguno, debéis facilitar los datos de soporte oportunos por favor, mirad aquí y leer las Normas generales del foro, esto nos servirá de ayuda para dar el mejor soporte..

Gracias.

La Administración de phpBB España.

Archivo adjunto en script php emailer

PHP, HTML, CSS, JS, jQuery, etc.
JoshuaProvoste
Observador/a
Mensajes: 1
Registrado: 01 May 2013, 07:14

Archivo adjunto en script php emailer

#1

Mensaje por JoshuaProvoste »

Hola chicos,

Soy nuevo en el foro y he llegado hasta acá porque tengo un script php al cual necesito añadir las variables de php necesarias para que soporte el envío de archivos adjuntos; sólo he logrado añadir el input para seleccionar el archivo. Les dejo el código completo del script para ver si alguno de ustedes puede ayudarme, ¡por favor! Saludos y muchas gracias!! :o :?:

Código:

Código: Seleccionar todo

<?php
/*
PHP Email 
=========================
   php email
=========================
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title> PHP Email </title>
<meta name="Generator" content="PHP Email" />
<meta name="Description" content="PHP email" />
<meta name="Keywords" content="php, email" />
</head>

<body>
<form method="post" action="">
<b>Email:</b>
<input type="text" name="emailto" size="53"><br />
<b>Email From:</b>
<input type="text" name="emailfrom" size="53"><br />
<b>Subject:</b>
<input type="text" name="subject" size="53"><br />
<b>Adjuntar archivo:</b> 
<input type='file' name='archivo1' id='archivo1'><br />
<b>Message:</b><br />
<textarea name="message" rows="6" cols="40"></textarea>
<br /><br />

<b>Send <input type="text" name="sendamount" size="1" value="1"> Email(s).</b> <input type="submit" name="sendemail" value="Send Email!">
</form>

<?php
if (isset($_REQUEST['sendemail'])){
$emailto = $_POST['emailto'];
$emailfrom = "From: ".$_POST['emailfrom'];
$subject = $_POST['subject'];

$message = $_POST['message'];
$sendamount = $_POST['sendamount'];
$i = 0;
if ($emailto == ""){
echo "<br /><b>Error send email!</b>";
} else if ($emailfrom == ""){
echo "<br /><b>Error send email!</b>";
} else if ($subject == ""){
echo "<br /><b>Error send email!</b>";
} else if ($message == ""){
echo "<br /><b>Error send email!</b>";
} else if ($sendamount == ""){
echo "<br /><b>Error send email!</b>";
} else {
do {
mail($emailto, $subject, $message, $emailfrom);
$i++;

}
while ($i<$sendamount);
echo "<br /><b>You have successfully send ".$emailto." with ".$i." emails!</b>";
}
}
?>
</body>
</html>

Responder

Volver a “🆘 Recursos Webmaster”