mail function doesn't work

the mail() function

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 3
Joined: Sun Apr 27, 2014 7:49 am

mail function doesn't work

Postby abdbad2015 » Thu May 01, 2014 10:52 pm

Hi , I'm newbie in php.
my code is

Code: Select all

        // error reporting method will be discussed
            $title =$_post['title'];
            $name =$_post['name'];
            $message =$_post['message'];
            $body = "you have the following from".$name."<br/>";
            $body .= "<p><b>".$title."</b></p>";
            $body .= "<p>".$message."</p>";
             //build emial
             $to = "" ;
             $header="From : ($name)<($email)";
             $subject="you have 1 feedback";
                 echo "thank you for yourfeedback";
                 echo "unfortunatly , we have problem"; }

the problem is that it doesn't print the statement of [if] or the statement of [else] , why?

php-forum Fan User
php-forum Fan User
Posts: 858
Joined: Mon Oct 01, 2012 12:32 pm

Re: mail function doesn't work

Postby seandisanti » Thu May 01, 2014 11:32 pm

you can use if ($_POST) to check if the post superglobal is instantiated, but to check an individual element, you should use isset($_POST['submit'])

Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 1 guest