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'])

User avatar
New php-forum User
New php-forum User
Posts: 6
Joined: Fri Jun 05, 2015 2:26 am
Location: US

Fri May 02 2014 10 32 am

Postby Haddep36 » Fri Jun 12, 2015 1:10 am

I apologise, but it does not approach me. Who else, what can prompt?

Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 4 guests