在我看来,这是个无休止的话题...我已经阅读并重读了十几个帖子与同样的问题,我没有能够找到任何解决方案,以解决它在我的情况:例如,"Envío"显示为"Envío"在我收到的消息. 我的代码如下我已经修改了许多(许多).不同的建议,我已经找到,没有得到他们中的任何一个工作!
救命啊=(
<html lang="es">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<link href="assets/css/style.css" rel="stylesheet">
<link href="assets/css/custom.css" rel="stylesheet">
</head>
<body>
<div class="col-md-6">
<div class="form contact-form">
<?php
error_reporting(0);
$action=$_REQUEST['action'];
if ($action=="") /* display the contact form */
{
?>
<form class="php-email-form" id="contact-form" action="<?php $_SERVER["PHP_SELF"];?>" method="POST" enctype="multipart/form-data" autocomplete="etelpmocotua">
<input type="hidden" name="action" value="submit">
<div class="form-group">
<input class="form-control" type="text" name="name" value="" size="30" placeholder="Nombre" class="form-area" autocomplete="etelpmocotua" /></div>
<div class="form-group mt-3"><input class="form-control" type="text" name="email" value="" size="30" placeholder="e-Mail" class="form-area" autocomplete="etelpmocotua" /></div>
<div class="form-group mt-3"><input class="form-control" type="text" name="phone" value="" size="30" placeholder="Teléfono" class="form-area" autocomplete="etelpmocotua" /></div>
<textarea class="form-control mt-3" name="message" placeholder="Tu mensaje" class="form-area"></textarea>
<div class="my-3"><div class="loading">Enviando...</div></div>
<div class="text-left"><button type="submit">Enviar Mensaje</button></div>
</form>
<?php
}
else
{
$name=$_REQUEST['name'];
$email=$_REQUEST['email'];
$phone=$_REQUEST ['phone'];
$message=$_REQUEST['message'];
if (($name=="")||($email=="")||($phone=="")||($message==""))
{
echo "<div class='error-message'><strong>Tu mensaje no pudo ser enviado</strong><br>Por favor, completá todos los campos.<br>
<a href=\"javascript:history.back()\" target=\"_self\"><img src='assets/img/back.png' /></a></div>";
}
else{
$body .="Nuevo mensaje desde la web!\n
Nombre: $name
e-Mail: $email
Telefono: $phone\n
Mensaje:\n
$message";
$from .="From: 'web@mydomain.com'>\r\n Return-path: $email";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
$subject .="Contacto WEB";
mail("web@mydomain.com", $subject, $body, $from);
echo "<div class='sent-message'>Tu mensaje ha sido enviado<br />
y pronto será respondido.<br><br>
<strong>Gracias por contactarnos!<strong></div>";
}
}
?>
</div>
</div>
</body>