Wordpress 由于端点不安全,带有mailto操作的HTML表单无法工作
我试图通过直接在模板块上键入html代码(这与所需的视觉设计完全匹配)来创建wordpress表单,但它不起作用。我在chrome控制台上收到此错误消息: 混合内容:页面位于'https://protegetumarcaonline.com/”“是吗 通过安全连接加载,但包含针对 不安全终结点的邮件收件人:proyectosonline@isern.com'. 此端点 应通过安全连接提供 这是表格代码:Wordpress 由于端点不安全,带有mailto操作的HTML表单无法工作,wordpress,forms,mailto,mixed-content,insecure-connection,Wordpress,Forms,Mailto,Mixed Content,Insecure Connection,我试图通过直接在模板块上键入html代码(这与所需的视觉设计完全匹配)来创建wordpress表单,但它不起作用。我在chrome控制台上收到此错误消息: 混合内容:页面位于'https://protegetumarcaonline.com/”“是吗 通过安全连接加载,但包含针对 不安全终结点的邮件收件人:proyectosonline@isern.com'. 此端点 应通过安全连接提供 这是表格代码: <form action="mailto:proyectosonline@
<form action="mailto:proyectosonline@isern.com" method="get" enctype="text/plain">
SOBRE TI <br><br>
Nombre*<br>
<input style="width:100%;" type="text" name="nombre" required="" class="czr-focusable">
Email*<br>
<input style="width:100%;" type="text" name="email" required="" class="czr-focusable">
¿Tienes web?<br>
<input style="width:100%;" type="text" name="web" class="czr-focusable">
Marca*
<input style="width:100%;" type="text" name="marca" required="" class="czr-focusable">
Productos y/o Servicios de interés*
<textarea style="width: 100%; margin-top: 0px; margin-bottom: 0px; height: 82px;" name="mensaje" required="" class="czr-focusable"> </textarea>
<input type="checkbox" name="Facebook"> Facebook<br>
<input type="checkbox" name="Instagram"> Instagram<br>
<input type="checkbox" name="Twitter"> Twitter<br>
<input type="checkbox" name="Web propia"> Web propia<br>
<input type="checkbox" name="Amazon"> Amazon<br>
<input type="checkbox" name="Alibaba"> Alibaba<br>
<input type="checkbox" name="Otras"> Otras<br>
<input type="checkbox" required="" name="politica"> Acepto la política de privacidad*<br>
<input type="checkbox" name="comunicaciones"> Acepto recibir comunicaciones comerciales e informativas<br><br>
<input type="image" src="wp-content/uploads/2020/11/icono-ENVIAR.png" value="Enviar" name="enviar" alt="Enviar" width="110 style=" border:="" none;"="">
SOBRE TI
名称*
电子邮件*
?天狮网?
马卡*
产品/内部服务*
Facebook
Instagram
推特
Web propia
亚马逊
阿里巴巴
OTRA
公共政策委员会*
商业和信息交流中心
无法使用“mailto:”进行安全连接,因为mailto:会打开一个应用程序来发送邮件。可以使用或不使用安全协议(TLS)的应用程序
解决这个问题的一种方法是使用一个POST表单来调用PHP脚本来发送邮件。
因此,您的HTML如下所示:
<form method="post" action="/wp-content/php_scripts/send_mail.php">
SOBRE TI <br><br>
Nombre*<br>
<input style="width:100%;" type="text" name="nombre" required="" class="czr-focusable">
Email*<br>
<input style="width:100%;" type="text" name="email" required="" class="czr-focusable">
¿Tienes web?<br>
<input style="width:100%;" type="text" name="web" class="czr-focusable">
Marca*
<input style="width:100%;" type="text" name="marca" required="" class="czr-focusable">
Productos y/o Servicios de interés*
<textarea style="width: 100%; margin-top: 0px; margin-bottom: 0px; height: 82px;" name="mensaje" required="" class="czr-focusable"> </textarea>
<input type="checkbox" name="Facebook"> Facebook<br>
<input type="checkbox" name="Instagram"> Instagram<br>
<input type="checkbox" name="Twitter"> Twitter<br>
[...]
<input type="submit">
</form>
SOBRE TI
名称*
电子邮件*
?天狮网?
马卡*
产品/内部服务*
Facebook
Instagram
推特
[...]
以及您的PHP文件send_mail.PHP
<?php
/**
* Filter the mail content type.
*/
function wpdocs_set_html_mail_content_type() {
return 'text/html';
}
add_filter( 'wp_mail_content_type', 'wpdocs_set_html_mail_content_type' );
$message = '<p>Nombre:' . $_POST['nombre'] . '</p><p>Email:' . $_POST['email'] .'</p><p>...</p>';
$result = wp_mail('proyectosonline@isern.com', 'New mail', $message);
if ($result ) {
// Do something here
}
// Reset content-type to avoid conflicts -- https://core.trac.wordpress.org/ticket/23578
remove_filter( 'wp_mail_content_type', 'wpdocs_set_html_mail_content_type' );
?>
wp_邮件文件:
wp_mail_content_type:非常感谢Thomas,我现在在chrome控制台收到500个错误,没有消息。我已经设置了send_mail.php文件的所有权限。我还能做什么?非常感谢你,