PHP Email

Started by PF2G, September 10, 2011, 12:27:17 PM

PF2G

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

peterjack

Before we can send email with PHP, we need to set it up to do so, just as you need to set up your email program before it can send messages. Configuration for sending email in PHP is done with the php.ini file, so open up your Web server's php.ini in whichever editor you normally use.Email is the most popular Internet service today. A plenty of emails are sent and delivered each day. The goal of this tutorial is to demonstrate how to generate and send emails in PHP.