Arrays in mail with <select multiple>

the mail() function

Moderators: egami, macek, gesf

Post Reply
User avatar
New php-forum User
New php-forum User
Posts: 137
Joined: Wed Aug 31, 2011 3:55 am
Location: USA

Tue Sep 27, 2011 1:48 pm

Hi! cad, I will need to see your html page all so.

Here's what you should do.

Code: Select all


$name = $_POST['name'];
$company = $_POST['company'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$inquiry = $_POST['inquiry'];

$to  = "myemail";

    /* subject */
$subject = "Contact Form";

    /* message */
$message = <<< heredoc
<strong>Contact Form</strong><br>
<strong>Name:</strong>        $name<br>
<strong>Company:</strong>     $company<br>
<strong>Phone:</strong>       $phone<br>
<strong>Email:</strong>         $email<br>
foreach ($inquiry as $i) { 
echo "<strong>Inquiry:</strong>     $i<br>";
$headers = "MIME-Version: 1.0rn";
$headers .= "Content-type: text/html; charset=iso-8859-1";
/* additional headers */
$headers .= "To: Me <myemail>";
$headers .= "From: Contact Form <contactform@myemail>";

mail($to, $subject, $message, $headers);


Post Reply