Yekarum Posted August 29, 2013 Share Posted August 29, 2013 hi, first i have to say i don't know much of php, a friend asked me to help him in this.. got this landing page: http://www.kaizen10.com/coach/contact.html in which we modified and added some fields to the form.. but for some reason it is not working... as i am very noob in php, i realy can't get to the answer so thats why i am asking.. this are the codes both for the html forma nd php... html: <form id="contactform" class="form-contact" action="http://www.kaizen10.com/coach/mailer.php" method="post"> <div id="success" ></div> <!-- START - DADOS CADASTRAIS --> <input placeholder="Seu Nome" type="text" class="input-name" id="name" name="name" /> <input placeholder="Seu e-mail" type="text" class="input-email" id="email" name="email" /> <input placeholder="Profissão" type="text" class="input-name" id="profesion" name="profesion" /> <input placeholder="Telefone" type="text" class="input-email" id="telefono" name="telefono" /> <!-- END - DADOS CADASTRAIS --> <div class="tx"><p> As respostas oferecidas nesta ferramenta são de caráter estritamente CONFIDENCIAIS, sendo utilizadas apenas por você, nosso assessor e seu Coach. Você está pronto para o Coaching?</p></div> <!-- START - QUESTION RADIO --> <p class="questionh2"> 01 - Estou pronto para investir meu tempo em mim, e fazer o trabalho necessário para o meu desenvolvimento pessoal e profissional?</p> <div class="check"><input type="radio" name="pregunta1" id="pregunta1" value="sim" /> <p class="radio-label">SIM</p></div> <div class="check"><input type="radio" name="pregunta1" id="pregunta1" value="nao" /> <p class="radio-label">NÃO</p></div> <p class="questionh2"> 02 - Tenho objetivos a atingir que serão meu foco em coaching?</p> <div class="check"><input type="radio" name="pregunta2" id="pregunta2" value="sim" /> <p class="radio-label">SIM</p></div> <div class="check"><input type="radio" name="pregunta2" id="pregunta2" value="nao" /> <p class="radio-label">NÃO</p></div> <p class="questionh2"> 03 - Estou pronto a descartar comportamentos que impedem ou limitam o meu sucesso?</p> <div class="check"><input type="radio" name="pregunta3" id="pregunta3" value="sim" /> <p class="radio-label">SIM</p></div> <div class="check"><input type="radio" name="pregunta3" id="pregunta3" value="nao" /> <p class="radio-label">NÃO</p></div> <p class="questionh2"> 04 - Entendo que o foco do coaching é contribuir para que eu atinja minhas metas, diferentemente da terapia, a qual tem foco em traumas emocionais?</p> <div class="check"><input type="radio" name="pregunta4" id="pregunta4" value="sim" /> <p class="radio-label">SIM</p></div> <div class="check"><input type="radio" name="pregunta4" id="pregunta4" value="nao" /> <p class="radio-label">NÃO</p></div> <p class="questionh2"> 05 - Vou me empenhar em ter ações consistentes para atingir minhas metas, mesmo quando não alcançar resultados imediatos?</p> <div class="check"><input type="radio" name="pregunta5" id="pregunta5" value="sim" /> <p class="radio-label">SIM</p></div> <div class="check"><input type="radio" name="pregunta5" id="pregunta5" value="nao" /> <p class="radio-label">NÃO</p></div> <p class="questionh2"> 06 - Estou pronto para trabalhar em colaboração com o meu coaching para idealizar metas e planos de ação que me possibilitarão expandir minhas habilidades?</p> <div class="check"><input type="radio" name="pregunta6" id="pregunta6" value="sim" /> <p class="radio-label">SIM</p></div> <div class="check"><input type="radio" name="pregunta6" id="pregunta6" value="nao" /> <p class="radio-label">NÃO</p></div> <p class="questionh2"> 07 - Reconheço que sou totalmente RESPONSÁVEL por minha vida e pelas decisões que tomo?</p> <div class="check"><input type="radio" name="pregunta7" id="pregunta7" value="sim" /> <p class="radio-label">SIM</p></div> <div class="check"><input type="radio" name="pregunta7" id="pregunta7" value="nao" /> <p class="radio-label">NÃO</p></div> <p class="question"> Qual plano você encontra mais adecuado a sua realidade atual? </p> <div class="check"><input type="checkbox" name="plano" id="plano" value="silver" /> <p class="radio-label">SILVER</p></div> <div class="check"><input type="checkbox" name="plano" id="plano" value="gold" /> <p class="radio-label">GOLD</p></div> <div class="check"><input type="checkbox" name="plano" id="plano" value="platinum" /> <p class="radio-label">PLATINUM</p></div> <!-- END - QUESTION RADIO --> <div class="tx"><p> Responda as questões abaixo sem pressa. Não há respostas certa ou errada. O objetivo é definir onde você está hoje e o que você quer, do processo de coaching de sua vida em geral. Suas respostas são importantes para que se crie uma base sólida para o relacionamento de supervisão.</p></div> <!-- START - QUESTION TEXTAREA --> <p class="question"> 01 - O que voce espera do processo de Coaching?</p> <textarea placeholder="Resposta" class="message" name="pregunta8" id="pregunta8" rows="5" cols="20"></textarea> <p class="question"> 02 - Qual é a sua expectativa sobre seu Coach?</p> <textarea placeholder="Resposta" class="message" name="pregunta9" id="pregunta9" rows="5" cols="20"></textarea> <p class="question"> 03 - Qual é o objetivo prioritário que deseja trabalhar?</p> <textarea placeholder="Resposta" class="message" name="preguna10" id="pregunta10" rows="5" cols="20"></textarea> <!-- END - QUESTION TEXTAREA --> <input type="submit" class="input-submit" value="Enviar" id="send" /> </form> php: <?php $name = $_POST['name']; $email = $_POST['email']; $telefono = $_POST['telefono']; $profesion = $_POST['profesion']; $pregunta1 = $_POST['pregunta1']; $pregunta2 = $_POST['pregunta2']; $pregunta3 = $_POST['pregunta3']; $pregunta4 = $_POST['pregunta4']; $pregunta5 = $_POST['pregunta5']; $pregunta6 = $_POST['pregunta6']; $pregunta7 = $_POST['pregunta7']; $pregunta8 = $_POST['pregunta8']; $pregunta9 = $_POST['pregunta9']; $pregunta10 = $_POST['pregunta10']; $plano = $_POST['plano']; $to = 'clientes@kaizen10.com.br'; $subject = 'Entrevista desde sitio web'; $message = 'FROM: '.$name.' Email: '.$email.' Respuestas: '.$pregunta1,'<br />'.$pregunta2,'<br />'.$pregunta3,'<br />'.$pregunta4,'<br />'.$pregunta5,'<br />'.$pregunta6,'<br />'.$pregunta7,'<br />'.$plano,'<br />'.$pregunta8,'<br />'.$pregunta9,'<br />'.$pregunta10,; $headers = 'From: clientes@kaizen10.com.br' . "\r\n"; if (filter_var($email, FILTER_VALIDATE_EMAIL)) { mail($to, $subject, $message, $headers); echo "Your email was sent!"; }else{ echo "Invalid Email, please provide an correct email."; } ?> i appreciate a lot if someone can help me in this... thanks Quote Link to comment https://forums.phpfreaks.com/topic/281673-php-for-email-not-working/ Share on other sites More sharing options...
fastsol Posted August 29, 2013 Share Posted August 29, 2013 You have some syntax errors in the $message. You start by using . to concatenate then you change to , which is wrong. Here is a snippet of that code, notice the, after the last var $message = 'FROM: '.$name.' Email: '.$email.' Respuestas: '.$pregunta1,'<br />' Change all those , in that line to start with. Have you checked your spam folder to make sure it's not in there, that is very common when making very simple email scripts like this cause they don't have all the headers that most email clients require to validate an email against spam. Quote Link to comment https://forums.phpfreaks.com/topic/281673-php-for-email-not-working/#findComment-1447345 Share on other sites More sharing options...
Yekarum Posted August 29, 2013 Author Share Posted August 29, 2013 thanks a lot!!! did the changes... but still not sending the email i think... :S Quote Link to comment https://forums.phpfreaks.com/topic/281673-php-for-email-not-working/#findComment-1447347 Share on other sites More sharing options...
fastsol Posted August 29, 2013 Share Posted August 29, 2013 To verify that the script is actually sending the email you can do this if(mail($to, $subject, $message, $headers) === TRUE) { echo "Your email was sent!"; } else { echo 'Email NOT Sent'; } That way you'll know if it was sent and then you can focus your energy on the headers and stuff it you don't receive the email. CHECK YOUR SPAM BOX Quote Link to comment https://forums.phpfreaks.com/topic/281673-php-for-email-not-working/#findComment-1447351 Share on other sites More sharing options...
Yekarum Posted August 29, 2013 Author Share Posted August 29, 2013 no, you see i tried, but it will not show the echo.. i really don't know whats going on.. Quote Link to comment https://forums.phpfreaks.com/topic/281673-php-for-email-not-working/#findComment-1447397 Share on other sites More sharing options...
fastsol Posted August 30, 2013 Share Posted August 30, 2013 What does it echo when you submit to the page? Nothing or something, what? Quote Link to comment https://forums.phpfreaks.com/topic/281673-php-for-email-not-working/#findComment-1447402 Share on other sites More sharing options...
Yekarum Posted August 30, 2013 Author Share Posted August 30, 2013 nothing it keeps in the same page... it prints on the top of the div the message that the mail was sent.. but it never was sent... Quote Link to comment https://forums.phpfreaks.com/topic/281673-php-for-email-not-working/#findComment-1447404 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.