PHP电子邮件表单按钮不适用于某些电子邮件服务?

时间:2017-03-14 18:40:54

标签: php html forms email button

我尝试使用带有一些html的php向客户发送电子邮件,我希望它们包含一个表单。它适用于Gmail,但在其他电子邮件提供商中,提交按钮不起作用(单击它不会执行任何操作)。我可以做些简单的事情来使按钮在所有电子邮件中都有效吗?

从其他帖子我认为它可能与From:{$ noreply_email}有关。但我不知道该改变什么,或者是否能解决所有问题。可能是动作链接仍然是http而不是https?

我可以在他们可以复制的电子邮件中打印备份链接,但我也想将一些值发送到它指向的URL,如果我使用GET而不是POST,它将使$ pass_var可见。我希望隐藏它以证明电子邮件不是假的。

其他网站如何让他们的电子邮件按钮工作?

$pass_var = "notsosecretpassword55";
$noreply_email = "noreply.com";

$to = $primary_email; //the customer's email
$headers = "From: {$noreply_email} \r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$subject = "Email Confirmation";

$body = '<html><body>

<p class="headings3">Please click the email confirmation button below to verify this email, as it is the primary means of communication that we will use.</p>

<form action="http://project.com/customer_validated.php" method="post" style="padding: 0; margin: 0; display: inline;">
     <input type="hidden" name="email" value="'.$primary_email.'">
     <input type="hidden" name="pass" value="'.$pass_var.'">
     <input type="submit" style="width: 200px;" name="validated" value="Confirm Email"/>
</form>

<p class="text">Thank you</p>                       

</body></html>';

if (mail($to, $subject, $body, $headers)) {
    //echo "<br/>EMAIL SENT";
} else { 
    //echo "<br/>EMAIL NOT SENT"; 
}

0 个答案:

没有答案