if
(isset(
$_POST
[
'Submit'
])) {
// Prepare message
$msg
=
"Time: "
.
date
(
"d/m/y g:ia"
, time()) .
"\n"
;
foreach
(
$_POST
as
$field
=>
$value
) {
if
(
$field
!=
"submit"
)
$msg
.=
$field
.
": "
.
$value
.
"\n"
;
}
// Email was sent successfully
}
else
{
// Error sending email
}
}