alapimba Posted March 5, 2007 Share Posted March 5, 2007 what can be wrong on this script? <?php $data = date("d/m/Y"); $sendTo = "[email protected]"; $subject = "Inscrição no clube"; $nome = $_POST['nome']; $morada = $_POST['morada']; $codigopostal = $_POST['codigopostal']; $localidade = $_POST['localidade']; $telefone = $_POST['telefone']; $telemovel = $_POST['telemovel']; $email = $_POST['email']; $marca = $_POST['marca']; $modelo = $_POST['modelo']; $matricula = $_POST['matricula']; $ano = $_POST['ano']; $cor = $_POST['cor']; $notas = $_POST['notas']; if( !eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@([a-z0-9]+([\.-][a-z0-9]+))*$",$email)){ echo "Por favor, preencha um e-mail válido<br> <a href=\"inscricao.html\">voltar</a>"; } elseif ($_POST["nome"] == "") { echo "Por favor preencha o seu nome (*)<br> <a href=\"inscricao.html\">voltar</a>"; } elseif ($_POST["morada"] == "") { echo "Por favor preencha a sua morada (*)<br> <a href=\"inscricao.html\">voltar</a>"; } elseif ($_POST["localidade"] == "") { echo "Por favor preencha a sua localidade (*)<br> <a href=\"inscricao.html\">voltar</a>"; } elseif ($_POST["codigopostal"] == "") { echo "Por favor preencha o seu codigo postal (*)<br> <a href=\"inscricao.html\">voltar</a>"; } elseif ($_POST["telemovel"] == "") { echo "Por favor preencha o seu telemovel (*)<br> <a href=\"inscricao.html\">voltar</a>"; } elseif ($_POST["marca"] == "") { echo "Por favor preencha a marca do seu carro (*)<br> <a href=\"inscricao.html\">voltar</a>"; } elseif ($_POST["modelo"] == "") { echo "Por favor preencha o modelo do seu carro (*)<br> <a href=\"inscricao.html\">voltar</a>"; } elseif ($_POST["matricula"] == "") { echo "Por favor preencha a matricula do seu carro (*)<br> <a href=\"inscricao.html\">voltar</a>"; } elseif ($_POST["ano"] == "") { echo "Por favor preencha o ano do seu carro (*)<br> <a href=\"inscricao.html\">voltar</a>"; } elseif ($_POST["cor"] == "") { echo "Por favor preencha a cor do seu carro (*)<br> <a href=\"inscricao.html\">voltar</a>"; } else { $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: " . $_POST['nome'] . " <" . $_POST['email'] . ">\r\n"; $headers .= "<" . $_POST["email"] .">\r\n"; $headers .= "Reply-To: " . $_POST["email"]; $message = "Inscrição no clube 600 e 500\r\n"; $message.= " <html> <head> <title>Untitled Document</title> <style type=\"text/css\"> <!-- .style1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; } .style2 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; } --> </style> </head> <body bgcolor=\"ffffff\"> <p class=\"style2\"><img src=\"http://www.clube600500.net/img/logo_club.png\" width=\"188\" height=\"192\"><br> Inscrição no Clube Amigos 600 e 500 </p> <p class=\"style1\">DADOS PESSOAIS <br/> <br/> <strong>Nome:</strong> $nome <strong><br/> Morada:</strong> $morada<strong><br /> Codigo postal:</strong> $codigopostal<strong><br /> Localidade:</strong> $localidade<strong><br /> Telemovel:</strong> $telemovel<strong><br /> Telefone:</strong> $telefone<strong><br /> E-mail:</strong> email<br /> <br /> INFORMAÇOES VEÍCULO <br /> <br /> <strong>Marca:</strong> $marca<strong><br /> modelo:</strong> $modelo<strong><br /> Matricula:</strong> $matricula<strong><br /> Ano:</strong> $ano<strong><br /> Cor:</strong> $cor</p> <p class=\"style1\"><strong>Notas:</strong> $notas</p> <p class=\"style1\"><strong>data:</strong> $data </p> </body> </html> "; // once the variables have been defined, they can be included // in the mail function call which will send you an email mail($sendTo, $subject, $message, $headers); echo "<html> <head> <style type=\"text/css\"> <!-- .style1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; } .style2 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; } body { margin-left: 30px; margin-top: 30px; } --> </style> </head> <body> <p class=\"style2\"><img src=\"http://www.clube600500.net/img/logo_club.png\" width=\"188\" height=\"192\"><br> Inscrição no Clube Amigos 600 e 500 </p> <p class=\"style1\">DADOS PESSOAIS <br/> <br/> <strong>Nome:</strong> $nome <strong><br/> Morada:</strong> $morada<strong><br /> Codigo postal:</strong> $codigopostal<strong><br /> Localidade:</strong> $localidade<strong><br /> Telemovel:</strong> $telemovel<strong><br /> Telefone:</strong> $telefone<strong><br /> E-mail:</strong> email<br /> <br /> INFORMAÇOES VEÍCULO <br /> <br /> <strong>Marca:</strong> $marca<strong><br /> modelo:</strong> $modelo<strong><br /> Matricula:</strong> $matricula<strong><br /> Ano:</strong> $ano<strong><br /> Cor:</strong> $cor</p> <p class=\"style1\"><strong>Notas:</strong> $notas</p> <p class=\"style1\"><strong>data:</strong> $data </p><br> <br> A sua mensagem com enviada com sucesso. Por favor imprima o formulário<br> <A HREF=\"javascript:window.print()\">Click para imprimir</A><br> <a href=\"index.html\">Voltar ao site<a/> </body> </html>"; } ?> It's sending to the email the text: Reply-To: " . $_POST["email"]; Inscrição no clube 600 e 500 Any idea? Link to comment https://forums.phpfreaks.com/topic/41281-what-is-wrong-with-this-mail-script/ Share on other sites More sharing options...
Orio Posted March 5, 2007 Share Posted March 5, 2007 What error are you getting...? Also- please edit your post and put your code in between code tags (put it between {code}{/code} -> just replace the curly brackets with square ones). Orio. Link to comment https://forums.phpfreaks.com/topic/41281-what-is-wrong-with-this-mail-script/#findComment-200005 Share on other sites More sharing options...
alapimba Posted March 6, 2007 Author Share Posted March 6, 2007 can't find the place to edit the post ??? :-\ The error is that, the script is to send a form to one email, at this moment it's sending the $message as i want but it's also printing to the e-mail this: "Reply-To: " . $_POST["email"]; Inscrição no clube 600 e 500\r\n";" Link to comment https://forums.phpfreaks.com/topic/41281-what-is-wrong-with-this-mail-script/#findComment-200669 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.