...

View Full Version : Pf2g



PF2G
09-10-2011, 05:29 PM
Hi everybody!!

I'm creating a website for a Music School and i'm working on a 'Contact' page, where the user can say anything and when the message is submited, it's automatically send to my email.

But i'm having problems:


<?php

include 'topo.php';

//Verifica como é que o envio é feito

if(isset($hidSubmit))

{

//Declarar variáveis

$mail_to = "paulo.devil92@gmail.com";

$name = $_POST['nome'];

$mail_from = $_POST['email'];

$mail_sub = "EMInfante";

$mail_mesg = $_POST['mensagem'];

$head = 'From: ' . $name . ' - ' . $email_from;

//Entregue com sucesso/falhado

if(mail($name,$mail_from,$mail_sub,$mail_msg))

{

echo "<span class='red'>E-mail has been sent successfully from $mail_sub to $mail_to</span>";

}

else

{

echo "<span class='red'>Failed to send the E-mail from $mail_sub to $mail_to</span>";

}

}

?>

But i don't recieve the message that is suppose to appear:


echo "<span class='red'>E-mail has been sent successfully from $mail_sub to $mail_to</span>";
}
else
{
echo "<span class='red'>Failed to send the E-mail from $mail_sub to $mail_to</span>";
Can someone help me?

PLEASE I NEED IT AS SOON AS POSSIBLE

Thank you

BluePanther
09-10-2011, 08:23 PM
Set up an else for your if(isset($hidSubmit)). I can't see any assignment to $hidSubmit in your script unless it's in the included topo.php, or this script is included somewhere else that assigns the variable.

In other words, verify the value of $hidSumbit as I have a feeling it isn't set.

PF2G
09-23-2011, 11:10 PM
After several day of hard work i now can send email 8)

But message doen't show :(



if (isset($_REQUEST['email']))
{
//send email
$to = 'paulo.devil92@gmail.com' ;
$subject = "Dúvida/Comentário Escola Música VNG" ;
$email = $_REQUEST['email'] ;
$nome = $_REQUEST['nome'] ;
$msg = $_REQUEST['mensagem'] ;

if (mail($to, $subject, "From: " . $nome, $email, $msg))
{
echo "Mensagem enviada com sucesso. Obriagado!!";
header("Location: http://escolamusicavng.net16.net/contact.php");
}
else
{
echo "Envio falhado. Tente mais tarde.";



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum