PHP Email

  • 1 Replies
  • 1074 Views
*

PF2G

  • Newbie
  • *
  • 4
  • +0/-0
    • View Profile
PHP Email
« on: September 10, 2011, 12:27:17 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:

Code: [Select]
<?php

include &#39;topo.php&#39;;

//Verifica como é que o envio é feito

if(isset($hidSubmit))

{

//Declarar variáveis

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

$name $_POST[&#39;nome&#39;];

$mail_from $_POST[&#39;email&#39;];

$mail_sub "EMInfante";

$mail_mesg $_POST[&#39;mensagem&#39;];

$head = &#39;From: &#39; . $name . &#39; - &#39; . $email_from;

//Entregue com sucesso/falhado

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

{

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

}

else

{

  echo 
"<span class=&#39;red&#39;>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:
Code: [Select]
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
« Last Edit: September 10, 2011, 01:26:40 PM by PF2G »

*

peterjack

  • Newbie
  • *
  • 5
  • +0/-0
    • View Profile
Re: PHP Email
« Reply #1 on: September 21, 2011, 03:13:37 AM »
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.

 




See Our Webmaster Tools for Windows and Mac

A1 Sitemap Generator
      
A1 Website Analyzer
      
A1 Keyword Research
      
A1 Website Download
      
A1 Website Search Engine
      
A1 Website Scraper