Hola gente,
Explico: tengo un listado de email en un BD, necesito enviarles un email a ese listado, para eso compongo un email y con foreach selecciono los email de la lista, el problema es que no los puedo listar dentro del formulario para enviar el email.
El codigo es este:
Código PHP:
Ver original...........
if(isset($_POST['select'])) {
$seleccion=$_POST['select'];
foreach($seleccion as $indice => $valor)
{
print $valor (aqui me muestra la lista de email que he seleccionado pero yo lo necesito en la linea 65)
}
echo "
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>Send Email</title>
<link rel='stylesheet' type='text/css' href='css/estilo.css' />
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<script language='javascript' type='text/javascript' src='scripts/tiny_mce.js'></script>
<script language='javascript' type='text/javascript'>
tinyMCE.init({
mode : 'textareas',
theme : 'advanced',
theme_advanced_buttons1 : 'bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink',
theme_advanced_buttons2 : '',
theme_advanced_buttons3 : '',
theme_advanced_toolbar_location : 'top',
theme_advanced_toolbar_align : 'left',
theme_advanced_path_location : 'bottom',
extended_valid_elements : 'a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]'
});
</script>
<script>
function irA(url){
location.href = url;
}
</script>
<script type=\"text/javascript\">
function posicion(){
moveTo(0,0);
ancho_popup=870;
alto_popup=730;
x=(screen.width-ancho_popup)/2;
moveTo(x,0);
y=(screen.height-alto_popup)/2;
moveTo(x,y);
}
</script>
</head>
<body onload=\"posicion();\">
<form action='enviaremail.php' enctype='multipart/form-data' method='post' name='form1'>
<div id='menu_mail'>
<div id='send'>
<input name='submit' type='image' id='boton' src='images/sendmail.png' alt='send mail' />
</div>
<div id='imgattch'>
<input name='archivo' type='file' id='archivo' alt='Attach file'/>
</div>
</div>
<table id='correo' border=0>
<tr>
<td><label>Sender:<td> Carfreight INC.</td></label><br /></td>
</tr>
<tr>
<td><label>E-mail List:</label></td><td><input name='email' id='email' type='text' value='".$valor."' size='80px'></td> (aqui necesito que me aparezcan todos los email que he seleccionado, pero solo me muestra el último de la lista)
</tr>
<tr>
<td><label>Subjet:</label></td><td><input type='text' name='asunto' size='80px' value='Cotización de Transporte'/></td><br />
</tr>
</table>
<table border=0>
.......................
Alquien me puede dar una mano por favor.
Desde ya muchas gracias por el tiempo prestado.