talhaMalik22 talhaMalik22 - 4 months ago 7
PHP Question

Email Form more than 20 values

I have a form with more than 20 input fields. The PHP

mail
function is not working since it can only accept 5 parameters. How can I send these values to my email address?

Answer
$to = 'myemail@mydomain.com';
$subject = 'form values';
$message = '';

foreach( $_POST as $key => $ value ) {
  $message .= $key . ' => ' . $value  . '<br>';
}

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