By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,934 Members | 1,476 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,934 IT Pros & Developers. It's quick & easy.

send feedback to multiple emails

P: 1
<?php


// get posted data into local variables

$EmailFrom = Trim(stripslashes($_POST[email]));

$EmailTo = "abc@abclcom.com";

$Subject = "Website Feedback";

$Name = Trim(stripslashes($_POST[name]));

$Telephone = Trim(stripslashes($_POST[phone]));

$Country = Trim(stripslashes($_POST[country]));

$Comment = Trim(stripslashes($_POST[comm]));

// prepare email body text

$Body = "";

$Body .= "Name: ";

$Body .= $Name;

$Body .= "\n";

$Body .= "Telephone: ";

$Body .= $Telephone;

$Body .= "\n";

$Body .= "Country: ";

$Body .= $Country;

$Body .= "\n";

$Body .= "Email ID: ";

$Body .= $EmailFrom;

$Body .= "\n";

$Body .= "Comments: ";

$Body .= "\n";

$Body .= $Comment;

$Body .= "\n";

$Body .= "\n";

// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page
if ($success){
echo<<<End
Aug 6 '07 #1
Share this Question
Share on Google+
1 Reply


P: 9
is this a question?

if you're trying to send to mutiple addresses you'll need to accept an array as your TO data unless you have hard coded values or you're reading from a database, then you could run a for each loop running mail() function on each value..
Nov 25 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.