[英]Confirmation email from PHP form
我有一个很好的php形式。 确认电子邮件将发送给用户,但我希望它在消息之前在此处张贴名称。 它不会立即发布名称。 只需发布消息。 我希望它说类似的内容。,谢谢FULL_Name(然后发送消息)任何帮助都会动摇。
// Subject of confirmation email.
$conf_subject = 'Test Message';
// Who should the confirmation email be from?
$conf_sender = 'Test <no-reply@test.com>';
$msg .= $_POST['Full_Name']."\n";
$msg = "Thank you for your recent inquiry If you have any questions please call us at 555-555-5555 \n\n";
mail( $_POST['Email_Address'], $conf_subject, $msg, "From: $conf_sender" );
如果我正确理解这一点,则只需要在字符串中插入变量即可。
$name = $_POST['Full_Name'];
$msg = "Thank you ".$name." for your recent inquiry If you have any questions please call us at 555-555-5555 \n\n";
在您的代码中,您要将full_name添加到$ msg。 然后用消息替换变量的内容:
$msg .= $_POST['Full_Name']."\n";
$msg = "Thank you for your recent inquiry If you have any questions please call us at 555-555-5555 \n\n";
在这段代码中,您首先要使用full_name设置$ msg,然后添加其余消息。
$msg = $_POST['Full_Name']."\n";
$msg .= "Thank you for your recent inquiry If you have any questions please call us at 555-555-5555 \n\n";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.