我正在使用 PHPMailer 收集表单数据并发送和自动回复用户邮件。我有 3 个不同的单选按钮可供选择。我需要根据选定的单选按钮自定义自动响应。
<form action="mailer.php" method="POST" name="xform">
<input type="radio" name="summit" id="summit" value="bird" >
<label for="summit">regular</label>
<input type="radio" name="summit" id="summit1" value="duck">
<label for="summit1">vip</label>
<input type="radio" name="summit" id="summit2" value="eagle">
<label for="summit2">vvip</label>
<button name="submitted" type="submit" >Send</button>
</form>
For PHPMAILER
if(isset($_POST['submitted'])){
$which = $_POST['summit'];
<!--this picks the selected radio button value -->
}
<!--For Autoresponse -->
if($mail->send()){
$autoemail->Body = "I need a way to customize this body of the auto respose mail in accordance with the selected radio button, like if $which is an array, how do I customize the auto response in accordance with the selected child";
}
请注意,我的 PHPMAILER 配置工作正常,没有问题。