Page 1 of 1

send email, to dinamic addressee

Posted: Mon Aug 23, 2010 8:26 am
by tac
can help with the code to do this:

I have a form with the following fields:

NAME1

NAME2, EMAIL2

NAME3, EMAIL3


I want to send emails, the emails entered EMAILx fields, including the following phrase, "NAME2, we recommend NAME1" in subject.

thanks for the help

Re: send email, to dinamic addressee

Posted: Mon Aug 23, 2010 8:40 am
by agriz
Is that form going to have only two receipt email address?

Re: send email, to dinamic addressee

Posted: Mon Aug 23, 2010 8:49 am
by tac
Nop,

form in detail:

first part: NAME1, PHONE, ID, EMAIL

second part:

NAME2, EMAIL2

NAME3, EMAIL3

NAME4, EMAIL4

NAME5, EMAIL5

NAME6, EMAIL6

to first part i used "foreach" to send all data colect to mi email (in html)

But i need a second part to send mail to each of other name at your emails

this is my code for the first part

Code: Select all

<?
$mensaje = "";
foreach ($_POST as $llave=>$dato) {
	if ($llave != "Submit")
		$mensaje .= "$llave: $dato\n";
}
//$to="sorteoancel@lafiestainolvidable.com.uy";
$to="sorteoancel@lafiestainolvidable.com.uy";
$subject="INSCRIPCION SORTEO ANCEL";

mail($to,$subject,$mensaje,"From: La Fiesta Inolvidable<No Replay>");

?><title>La Fiesta Inolvidable</title>
<style type="text/css">
<!--
body {
	background-color: #000000;
	background-image: url();
}
.Estilo1 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #CCCCCC;
}
.Estilo15 {font-size: 10px; color: #CCCCCC; }
.Estilo16 {color: #FF0000}
.Estilo17 {	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: bold;
	color: #CCCCCC;
}
.Estilo17 {	font-size: 12px;
	color: #CCCCCC;
	font-weight: bold;
}
-->
</style></head>

<body>
<meta name="keywords" content="nostalgia,sorteo,gratis">

</body>
</html>