PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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;
$head =
//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>";
}
}
?>
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>";
<?php
//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>";
}
}
?>
<?php
//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>";
}
}
?>
Sorry but i didn't understandd. Is something wrong in the echo?