Arrays in mail with <select multiple>

the mail() function

Moderators: macek, egami, gesf

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

Re: Arrays in mail with <select multiple>

Post by bigjoe11a » 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

<?php

$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>
heredoc;
    
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

Who is online

Users browsing this forum: No registered users and 2 guests