TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   array to email... (http://www.talkphp.com/general/3320-array-email.html)

Peuplarchie 09-05-2008 04:46 AM

array to email...
 
Good day to you all,
I was wondering how can I make my array listed in my email script below.
I know how to send an e-mail, I pass it through a form...

Here is it:

PHP Code:


 <?php
$pics 
$_POST["pics"];


foreach (
$pics as $p) {
echo 
$p."<br />";
}






$to "franck@peuplies.info, fbeausol@justice.gc.ca";
$from_header "From: franck@peuplies.info";

$subject "Salut Marc, voici le choix d'Andrew.";
$contents "$pics";
if(
$contents != "$p")
{
   
//send mail - $subject & $contents come from surfer input
   
mail($to$subject$contents$from_header);
   
// redirect back to url visitor came from
   
header("Location: images.php?folder=Andrew/View");
}
  else
{
   print(
"<HTML><BODY>Error, no comments were submitted!");
   print(
"</BODY></HTML>");
}







?>


Thank for any help with this !

almsamim 09-05-2008 10:40 PM

do u want to send to a lot of e-mails from an array ?!

tony 09-08-2008 05:34 AM

are you trying to add an array of pics to the content of your email?

if that's the case you need to flat out the email in the content variable. more so like this:

PHP Code:

 <?php
$pics 
$_POST["pics"];
if (empty(
$pics[0])){
    foreach (
$pics as $p)
        
$contents .= $p."<br />"//this is of course assuming that each $p value is a valid image tag

    
$to "franck@peuplies.info, fbeausol@justice.gc.ca";
    
$from_header "From: franck@peuplies.info";

    
$subject "Salut Marc, voici le choix d'Andrew.";
    
//send mail - $subject & $contents come from surfer input
    
mail($to$subject$contents$from_header);
    
// redirect back to url visitor came from
    //$_SERVER['HTTP_REFERER']  already has the address of the page (if any) which referred the user agent to the current page
    
header("Location: ".$_SERVER['HTTP_REFERER']);
}else{
    
$error_msg="Error, no comments were submitted!";
}
?>

I hope that makes sense or that is what you asked


All times are GMT. The time now is 01:13 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0