PHP Email
Posted: Sat Sep 10, 2011 11:04 am
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:
The line it is giving an error about "unexpected T_IF".
Can someone help me?
PLEASE I NEED IT AS SOON AS POSSIBLE
Thank you
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:
Code: Select all
<?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>";
}
}
?>Code: Select all
if(mail($name,$mail_from,$mail_sub,$mail_msg))Can someone help me?
PLEASE I NEED IT AS SOON AS POSSIBLE
Thank you