antrax Posted February 25, 2012 at 05:42 PM Report Share #441137 Posted February 25, 2012 at 05:42 PM boas alguem me pode ajudar a desenvolver um formulario que trabalhe...não consigo que chegue ao email o conteudo dos campos de registo.Estou a usar o wamp e estou a por o arquivo no www . Só preciso de ,nome:telefone:mensagem:e que chegue ao meu email....escrevo os dados a pagina diz que foi enviado mas não aparece nada no email. obrigado Link to comment Share on other sites More sharing options...
yoda Posted February 25, 2012 at 06:15 PM Report Share #441144 Posted February 25, 2012 at 06:15 PM O que tens / sabes até agora? before you post, what have you tried? - http://filipematias.info sense, purpose, direction Link to comment Share on other sites More sharing options...
antrax Posted February 25, 2012 at 06:47 PM Author Report Share #441147 Posted February 25, 2012 at 06:47 PM o problema é que nõa consigo com que o email receba os dados do formulario embora este diga que enviou.O codigo tirei da net .mando o codigo php: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php $date = date("d/m/Y h:i"); // ****** ATENÇÃO ******** // ABAIXO ESTÁ A CONFIGURAÇÃO DO SEU FORMULÁRIO. // ****** ATENÇÃO ******** // RECEBE OS VALORES VINDO DO FORMULÁRIO E ATRIBUI AS VARIÁVEIS $nome = $_POST['nome']; $email = $_POST['email']; $telefone = $_POST['telefone']; $cidade = $_POST['cidade']; $textodamensagem = $_POST['textodamensagem']; //CABEÇALHO - CONFIGURAÇÕES SOBRE SEUS DADOS E SEU WEBSITE $nome_do_site="ideiasprog"; $email_para_onde_vai_a_mensagem = "o meu email"; $nome_de_quem_recebe_a_mensagem = ""; $exibir_apos_enviar='enviado.html'; //MAIS - CONFIGURAÇOES DA MENSAGEM ORIGINAL $cabecalho_da_mensagem_original="From: $name <$email>\n"; $assunto_da_mensagem_original="Contato no Site"; // FORMA COMO RECEBERÁ O E-MAIL (FORMULÁRIO) // ******** OBS: SE FOR ADICIONAR NOVOS CAMPOS, ADICIONE OS CAMPOS NA VARIÁVEL ABAIXO ************* $configuracao_da_mensagem_original=" html: <html> <form name="senddata" method="post" action="form.php"> <table width="100%" border="0" cellspacing="2" cellpadding="2"> <tr> <td class="tahoma-02-cinza"><div align="right">Nome:<b><i><font size="1" face="Verdana" color="#FFFFFF"></font></i></b></div></td> <td><b><i><font size="1" face="Verdana" color="#FFFFFF"> <input name="nome" type="text" class="fomu" size="38"/> </font></i></b></td> </tr> <tr> <td class="tahoma-02-cinza"><div align="right"><b>E-mail:<i><font size="1" face="Verdana" color="#FFFFFF"></font></i></b></div></td> <td><b><i><font size="1" face="Verdana" color="#FFFFFF"> <input name="email" type="text" class="fomu" size="38"/> </font></i></b></td> </tr> <tr> <td class="tahoma-02-cinza"><div align="right">Telefone:<b><i><font size="1" face="Verdana" color="#FFFFFF"></font></i></b></div></td> <td><b><i><font size="1" face="Verdana" color="#FFFFFF"> <input name="telefone" type="text" class="fomu" id="telefone2" size="38"/> </font></i></b></td> </tr> <tr> <td class="tahoma-02-cinza"><div align="right"><b>Cidade:<i><b><i><font size="1" face="Verdana" color="#FFFFFF; color:#C40000"></font></i></b></i></b></div></td> <td><b><i><b><i><font size="1" face="Verdana" color="#FFFFFF; color:#C40000"> <input name="cidade" type="text" class="fomu" size="38"/> </font></i></b></i></b></td> </tr> <tr> <td class="tahoma-02-cinza"><div align="right">Assunto:<b><i><font size="1" face="Verdana" color="#FFFFFF; color:#C40000"></font></i></b></div></td> <td><b><i><font size="1" face="Verdana" color="#FFFFFF; color:#C40000"> <input name="assunto" type="text" class="fomu" size="38"/> </font></i></b></td> </tr> <tr> <td class="tahoma-02-cinza"><div align="right"><b>Mensagem:<i><font size="1" face="Verdana" color="#FFFFFF"></font></i></b></div></td> <td><b><i><font size="1" face="Verdana" color="#FFFFFF"> <textarea name="textodamensagem" cols="36" rows="4" class="fomu"></textarea> </font></i></b></td> </tr> <tr> <td></td> <td><input name="enviar" type="submit" class="formcop" value="Enviar Mensagem"/></td> </tr> </table> </form> </html> e a mensagem de enviou.... <html> Sua Mensagem foi enviada com sucesso </html> ele mostra a mensagem a dizer que enviou mas no emai não aparece nada. Link to comment Share on other sites More sharing options...
antrax Posted February 25, 2012 at 06:51 PM Author Report Share #441148 Posted February 25, 2012 at 06:51 PM falta linhas de codigo no php ,mando o codigo completo. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php $date = date("d/m/Y h:i"); // ****** ATENÇÃO ******** // ABAIXO ESTÁ A CONFIGURAÇÃO DO SEU FORMULÁRIO. // ****** ATENÇÃO ******** // RECEBE OS VALORES VINDO DO FORMULÁRIO E ATRIBUI AS VARIÁVEIS $nome = $_POST['nome']; $email = $_POST['email']; $telefone = $_POST['telefone']; $cidade = $_POST['cidade']; $textodamensagem = $_POST['textodamensagem']; //CABEÇALHO - CONFIGURAÇÕES SOBRE SEUS DADOS E SEU WEBSITE $nome_do_site="ideiasprog"; $email_para_onde_vai_a_mensagem = "antoniorosa2009@gmail.com"; $nome_de_quem_recebe_a_mensagem = "antonio"; $exibir_apos_enviar='enviado.html'; //MAIS - CONFIGURAÇOES DA MENSAGEM ORIGINAL $cabecalho_da_mensagem_original="From: $name <$email>\n"; $assunto_da_mensagem_original="Contato no Site"; // FORMA COMO RECEBERÁ O E-MAIL (FORMULÁRIO) // ******** OBS: SE FOR ADICIONAR NOVOS CAMPOS, ADICIONE OS CAMPOS NA VARIÁVEL ABAIXO ************* $configuracao_da_mensagem_original=" ENVIADO POR:\n Nome: $nome\n Email: $email\n Telefone: $telefone\n Cidade: $cidade\n Mensagem: $textodamensagem\n ENVIADO EM: $date "; //CONFIGURAÇÕES DA MENSAGEM DE RESPOSTA // CASO $assunto_digitado_pelo_usuario="s" ESSA VARIAVEL RECEBERA AUTOMATICAMENTE A CONFIGURACAO // "Re: $assunto" $assunto_da_mensagem_de_resposta = "Confirmação"; $cabecalho_da_mensagem_de_resposta = "From: $nome_do_site < $email_para_onde_vai_a_mensagem>\n"; $configuracao_da_mensagem_de_resposta="Obrigado por entrar em contato!\nEstaremos respondendo em breve...\nAtenciosamente,\n$nome_do_site\n\nEnviado em: $date"; // ****** IMPORTANTE ******** // A PARTIR DE AGORA RECOMENDA-SE QUE NÃO ALTERE O SCRIPT PARA QUE O SISTEMA FUNCIONE CORRETAMENTE // ****** IMPORTANTE ******** //ESSA VARIAVEL DEFINE SE É O USUARIO QUEM DIGITA O ASSUNTO OU SE DEVE ASSUMIR O ASSUNTO DEFINIDO //POR VOCÊ CASO O USUARIO DEFINA O ASSUNTO PONHA "s" NO LUGAR DE "n" E CRIE O CAMPO DE NOME //'assunto' NO FORMULARIO DE ENVIO $assunto_digitado_pelo_usuario="s"; //ENVIO DA MENSAGEM ORIGINAL $headers = "$cabecalho_da_mensagem_original"; if($assunto_digitado_pelo_usuario=="n"){ $assunto = "$assunto_da_mensagem_original"; } $seuemail = "$email_para_onde_vai_a_mensagem"; $mensagem = "$configuracao_da_mensagem_original"; mail($seuemail,$assunto,$mensagem,$headers); //ENVIO DE MENSAGEM DE RESPOSTA AUTOMATICA $headers = "$cabecalho_da_mensagem_de_resposta"; if($assunto_digitado_pelo_usuario=="n"){ $assunto = "$assunto_da_mensagem_de_resposta"; }else{ $assunto = "Re: $assunto"; } $mensagem = "$configuracao_da_mensagem_de_resposta"; mail($email,$assunto,$mensagem,$headers); echo "<script>window.location='$exibir_apos_enviar'</script>"; ?> </body> </html> Link to comment Share on other sites More sharing options...
yoda Posted February 25, 2012 at 07:01 PM Report Share #441150 Posted February 25, 2012 at 07:01 PM Estás a tentar enviar um formulário por email? before you post, what have you tried? - http://filipematias.info sense, purpose, direction Link to comment Share on other sites More sharing options...
antrax Posted February 25, 2012 at 11:50 PM Author Report Share #441171 Posted February 25, 2012 at 11:50 PM o que eu queria era receber as informaçõs no meu email... Link to comment Share on other sites More sharing options...
yoda Posted February 26, 2012 at 02:00 AM Report Share #441178 Posted February 26, 2012 at 02:00 AM Estás interessado em aprender ou apenas queres feito? before you post, what have you tried? - http://filipematias.info sense, purpose, direction Link to comment Share on other sites More sharing options...
antrax Posted February 26, 2012 at 10:29 AM Author Report Share #441184 Posted February 26, 2012 at 10:29 AM eu estava entressado em aprender ,sei fazer as tabelas html e o codigo php até aqui eu percebo num modo basico claro.Eu não consigo perceber é porque a informação não aparecer no meu email .Estou a usar o wamp e tenho o arquivo com a formulario html e a form.php na pasta www.até aqui acho que está tudo bem.Se me explicares e mandares o codigo a trabalhar agradeço. Link to comment Share on other sites More sharing options...
yoda Posted February 26, 2012 at 04:22 PM Report Share #441211 Posted February 26, 2012 at 04:22 PM Onde tens esse script a correr? Localmente ou num servidor na net? before you post, what have you tried? - http://filipematias.info sense, purpose, direction Link to comment Share on other sites More sharing options...
antrax Posted February 26, 2012 at 05:10 PM Author Report Share #441215 Posted February 26, 2012 at 05:10 PM localmente no wamp pasta www Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now