I will use this code for sending simple mail. But the time of execution the condition will be false..(else part)


   $message = "Hi you have a new Enquiry"."\r\n". "See Details below". "\r\n" . "Name :".$fname." "."\n". "Email :".$email. "\n"."Contact Number : ".$phone."\n"."Subject Number : ".$subject."\n"."remarks :".$remarks."\n";

        $subject='test message ' .$email;
        $headers= 'From: [email protected]' . "\r\n" .'Reply-To: [email protected]' . "\r\n" .'X-Mailer: PHP/' . phpversion();
        $headers.= 'MIME-Version: 1.0' . "\r\n";

          if(mail("[email protected]",$subject,$message,$headers)) {
             echo '<div class="text-center"> <p class="success" style="color: #d1287a; font-size: 26px;
            padding-top: 30px;">Thank you for  Registering  with us, We will Contact you Soon!   </p></div>';

        } else {
            echo 'Error while sending mail,Please try again later';

0 Answers