Skip to main content
New Participant
June 3, 2023
Question

contact form does not send emails

  • June 3, 2023
  • 1 reply
  • 327 views

hello everyone, the contact form on my site www.starasynagoga.pl/kontakt1.php deas not send emails. 

when i press button "send" i get : 

Warning: Use of undefined constant php - assumed 'php' (this will throw an Error in a future version of PHP) in /starasynagoga/contactform.php on line 1
Your message has been sent

 

the message I want to send does not go out.

Please advise what is wrong with php code in the contact form.  

Thank you 

    This topic has been closed for replies.

    1 reply

    BenPleysier
    Community Expert
    June 3, 2023

    The problem lies on line 9 of contactform.php, something about mail(): headers parameter must be string or array.

     

    For us to help you, please show the code of contactform.php.

    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
    Bogi13Author
    New Participant
    June 3, 2023

    hi , thank you for the reply, the code for contactform.php is the following 

    <?php>

    $from="noreply@website_URL_removed";
    $email="email_address_removed";
    $name=$_POST['Name'];
    $phone=$_POST['Phone'];
    $message=$_POST['Message'];

    mail ($email, $name, $phone, $message, "From:".$from);

    Print "Your message has been sent";

    ?>

     

    [Moderator's note: This is a public web forum, please don't post sensitive information here.]

    Brainiac
    June 3, 2023

    Is that the correct code? <?php> <----- theres a closing angle bracket that shouldnt be there.

     

    Do your form field names match the $_POST[''] variables i.e. 'Name' , 'Phone' and 'Message'?

     

    Obviously your form is insecure and validation of the input fields need to be added.