PHP - Problema con el receptor de formulario de contacto

 
Vista:

Problema con el receptor de formulario de contacto

Publicado por Ivan Raubert (2 intervenciones) el 19/11/2014 14:44:43
Hola Gente!

Estoy teniendo un problema con un formulario de contacto, al llenarlo el contenido llega al mail completado por el usuario y no al que deseo que llegue que está en la variable para. Copio el codigo, desde ya muchas gracias

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
if(isset($_POST["nombre"]) &&  isset($_POST["mail"]) && isset($_POST["comentarios"])){
	$para = "ivan_raubert@hotmail.com";
	$remitente = $_POST["mail"];
	$nombre = utf8_decode($_POST["nombre"]);
	$comentarios = utf8_decode($_POST["comentarios"]);
	$fecha = date("D-M-y H:i");
	$subject = "XXX";
 
	$texto = "Fecha: ".$fecha."\r\n";
	$texto .= "Nombre: ".$_POST["nombre"]."\r\n";
	$texto .= "De: ".$remitente."\r\n";
	$texto .= "Asunto: ".$_POST["asunto"]."\r\n";
	$texto .= "Comentarios: ".$_POST["comentarios"]."\r\n";
 
	$cabecera = "From:".$remitente."\n";
	$cabecera .= "Reply-To:".$remitente."\n";
	$cabecera .= "X-Mailer:PHP/".phpversion()."\r\n";
	$cabecera .= "Mime-Version: 1.0 \r\n";
	$cabecera .= "Content-Type: text/plain";
 
	$cabecera_html = "From:".$remitente."\r\n";
	$cabecera_html .= "Reply-To:".$remitente."\r\n";
	$cabecera_html .= "X-Mailer:PHP/".phpversion()."\r\n";
	$cabecera_html .= "Mime-Version: 1.0 \r\n";
	$cabecera_html .= "Content-type: text/html; charset=iso-8859-1"."\r\n";
 
	$contenido = '
		<html>
			<head>
			    <title>Consulta</title>
			 	<style type="text/css">
					body {
						margin-left: 0px;
						margin-top: 5px;
						margin-right: 0px;
						margin-bottom: 5px;
						background-image: url();
						background-color: #2E2E2A;
					}
					body,td,th {
						font-family: Tahoma;
						font-size: x-small;
						color: #000000;
					}
			    </style>
				<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
			</head>
		<body>
		    <table width="600" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#FFFFFF">
		          <tr>
		            <td align="left" valign="top">&nbsp;</td>
		            <td colspan="2" align="center" valign="top"><strong>Laundry Argentina - Formulario de consulta</strong></td>
		      </tr>
		          <tr>
		            <td align="left" valign="top">&nbsp;</td>
		            <td align="left" valign="top">&nbsp;</td>
		            <td width="502" align="left" valign="top">&nbsp;</td>
		      </tr>
		          <tr>
		            <td width="17" align="left" valign="top">&nbsp;</td>
		                <td width="81" align="left" valign="top"><strong>Fecha:</strong></td>
		                <td align="left" valign="top">'.$fecha.'</td>
		              </tr>
		          <tr>
		            <td width="17" align="left" valign="top">&nbsp;</td>
		                <td width="81" align="left" valign="top">&nbsp;</td>
		                <td align="left" valign="top">&nbsp;</td>
		              <tr>
		                <td width="17" align="left" valign="top">&nbsp;</td>
		                <td width="81" align="left" valign="top"><strong>Nombre:</strong></td>
		                <td align="left" valign="top">'.$nombre.'</td>
		              </tr>
		              <tr>
		                <td width="17" align="left" valign="top">&nbsp;</td>
		                <td width="81" align="left" valign="top">&nbsp;</td>
		                <td align="left" valign="top">&nbsp;</td>
		              </tr>
		          <tr>
		            <td width="17" align="left" valign="top">&nbsp;</td>
		                <td width="81" align="left" valign="top"><strong>email:</strong></td>
		                <td align="left" valign="top">'.$remitente.'</td>
		              </tr>
		              <tr>
		                <td width="17" align="left" valign="top">&nbsp;</td>
		                <td width="81" align="left" valign="top">&nbsp;</td>
		                <td align="left" valign="top">&nbsp;</td>
		              </tr>					  
		          <tr>
		            <td width="17" align="left" valign="top">&nbsp;</td>
		                <td width="81" align="left" valign="top"><strong>Comentario:</strong></td>
		                <td align="left" valign="top">'.$comentarios.'</td>
		              </tr>
		              <tr>
		                <td width="17">&nbsp;</td>
		                <td width="81">&nbsp;</td>
		                <td>&nbsp;</td>
		              </tr>
		                  <tr>
		                    <td colspan="3" width="600"></td>
		                  </tr>
		            </table>
		</body>
		</html>';
 
	/* $mensaje = utf8_decode($texto);
	mail($para, $subject, $mensaje, $cabecera); */
	$mensaje_copia = "Recibimos su consulta, en breve le responderemos";
 
	mail($para, $subject, $contenido, $cabecera_html);
	mail($remitente, $subject, $contenido, $cabecera_html);
	mail($remitente, $subject, $mensaje_copia, $cabecera_html);
	echo "&estatus=ok&";
}
?>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de xve
Val: 3.943
Oro
Ha mantenido su posición en PHP (en relación al último mes)
Gráfica de PHP

Problema con el receptor de formulario de contacto

Publicado por xve (6935 intervenciones) el 19/11/2014 18:56:25
Hola Ivan, no todos los servidores de correo admiten este tipo de correo enviado con la instrucción mail(), ya que no utiliza ningún servidor SMTP para el envio de los mensajes ( a no ser que se haya configurado en el archivo php.ini ).

Algunos servidores de correo, verifican que los correos recibidos vienen de un servidor SMTP existente... podría ser ese el problema?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Problema con el receptor de formulario de contacto

Publicado por Ivan Raubert (2 intervenciones) el 19/11/2014 19:11:47
Hola Jordan!

este archivo php envia un formulario hecho en flash, también intente con un codigo como este y no puedo lograrlo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
$mail='info@xxxx';
$subject = "::  xxxx  ::";
$fecha = date("D-M-y H:i");
$empresa = $_POST['empresa'];
$nombre = $_POST['nombre'];
$email = $_POST['correo'];
$consulta = $_POST["consulta"];
$thank="index.php";
$contenido = "Fecha: ".$fecha."\n";
$contenido .= "Nombre y Apellido: ".$_POST["nombre"]."\n";
$contenido .= "Institucion / Empresa: ".$_POST["empresa"]."\n";
$contenido .= "E-mail: ".$_POST["correo"]."\n";
$contenido .= "Consulta: ".$_POST["consulta"]."\n";
$header = "From:".$_POST["correo"]."\n";
$header .= "Reply-To:".$_POST["correo"]."\n";
$header .= "X-Mailer:PHP/".phpversion()."\n";
$header .= "Mime-Version: 1.0\n";
$header .= "Content-Type: text/plain";
$mensaje_copia = "Recibimos su consulta, en breve le responderemos.";
mail($remitente, $subject, $mensaje_copia, $header);
 
if (mail($mail,$subject,utf8_decode($contenido), $header))
{
header('location: contacto_ok.php');
die;
}else{
header('location: contacto.php');
}
?>
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar