• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

contact form does not send emails

New Here ,
Jun 03, 2023 Jun 03, 2023

Copy link to clipboard

Copied

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 

Views

138

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 03, 2023 Jun 03, 2023

Copy link to clipboard

Copied

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, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 03, 2023 Jun 03, 2023

Copy link to clipboard

Copied

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.]

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 03, 2023 Jun 03, 2023

Copy link to clipboard

Copied

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. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 03, 2023 Jun 03, 2023

Copy link to clipboard

Copied

Ask your hosting provider if your server supports the PHP Mail() function. Some hosts stopped allowing it to function for security reasons. 

 

As an alternative to Mail() function, PHPMailer is the script most hosting providers recommend.  You can get it free from GitHub.

https://github.com/PHPMailer/PHPMailer

 

Hope that helps.

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 05, 2023 Jun 05, 2023

Copy link to clipboard

Copied

LATEST

thank you, this is helpful 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines