我有 HTML 表单,它只通过 PHP 将填写的表单发送到电子邮件。好吧,我需要先将该信息发送到评论页面,让客户检查所有填写的信息,让他们审核并再次提交,然后才将该信息发送到电子邮件。这个怎么做?
这是代码:
<?php
// Please specify your Mail Server - Example: mail.yourdomain.com.
ini_set("SMTP", "mail.amaderica.com");
// Please specify an SMTP Number 25 and 8889 are valid SMTP Ports.
ini_set("smtp_port", "25");
// Please specify the return address to use
ini_set('sendmail_from', 'ravila@art.com');
$name = $_POST['Attention_To'];
// Set parameters of the email
$to = "ravila@art.com";
$subject = "Art Promo Items Ordered";
$from = " nostrowski@art.com";
$headers = "From: $from";
$message =
"Order has been placed. Attn to: $name .\n" .
"Items:\n";
foreach ($_POST as $fieldName => $fieldValue)
{
if (!empty($fieldValue))
$message .= " $fieldName: $fieldValue\n";
}
// Mail function that sends the email.
mail($to, $subject, $message, $headers);
header('Location: thank-you.html');
?>
我的表单中的一些字段是silver_name_badges
, coffee_mug
, plastic_bag
, paper_bag
, candy
, moist_towlette
, notepad_and_pen
, tuck_box
, red_tie
, cap
, red_lanyard
, 等。