[thelist] PHP mail with multiple recipients and form data not working

Joel D Canfield joel at spinhead.com
Wed Sep 17 09:16:02 CDT 2003


Can anyone see why this isn't working? No mail, blank response page.

Of course, I'm using real e-mail addresses and domain names ;)

Thanks ever so much

spinhead

====================================================================
<?php
$today = date("F j, Y, g:i a");

$fname = $_POST['fname'];
$lname = $_POST['lname'];
$coinst = $_POST['coinst'];
$address1 = $_POST['address1'];
$address2 = $_POST['address2'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$howfound = $_POST['howfound'];
$searchengine = $_POST['searchengine'];
$keywords = $_POST['keywords'];
$magenta = $_POST['magenta'];
$magentaoff = $_POST['magentaoff'];
$remclassic = $_POST['remclassic'];
$remoffice = $_POST['remoffice'];
$remweb = $_POST['remweb'];
$demomanual = $_POST['demomanual'];
$magoffinstructions = $_POST['magoffinstructions'];
$remarklit = $_POST['remarklit'];
$comments = $_POST['comments'];

ini_set('SMTP', "mail.example.com");

$email = "email at example.com";
$subject = "Website Download ($today)";

$body = "First Name: $fname\r\n";
$body .= "Last Name: $lname\r\n";
$body .= "Co/Institution: $coinst\r\n";
$body .= "Address1: $address1\r\n";
$body .= "Address2: $address2\r\n";
$body .= "City: $city\r\n";
$body .= "State: $state\r\n";
$body .= "Zip Code: $zip\r\n";
$body .= "Phone: $phone\r\n";
$body .= "E-mail: $email\r\n";
$body .= "How Found: $howfound\r\n";
$body .= "Search Engine: $searchengine\r\n";
$body .= "Keywords Used: $keywords\r\n";
$body .= "Magenta Demo: $magenta\r\n";
$body .= "Magenta Office Demo: $magentaoff\r\n";
$body .= "Remark Classic: $remclassic\r\n";
$body .= "Remark Office: $remoffice\r\n";
$body .= "Remark Web: $remweb\r\n";
$body .= "Demo Manual: $demomanual\r\n";
$body .= "Mag Office instructions: $magoffinstructions\r\n";
$body .= "Remark Lit: $remarklit\r\n";
$body .= "Comments: $comments\r\n"

$headers = "From: webmaster at example.com\n";
$headers .= "Reply-to: webmaster at example.com\n";
$headers .= "CC: email at yahoo.com\n";
$headers .= "Bcc: joel at spinhead.com\n";
$headers .= "Content-Type: text/plain; charset=iso-8859-1\n";

mail ($email, $subject, $body, $headers) or die("Could not send mail");

?>

====================================================================


More information about the thelist mailing list