I am currently creating a quote form for my company website, and wanted to make it a little more friendly than the usual "thank you everyone who fills out that form over there, and who I really don't care about..." I've tried two variations of the code and I've included the form code as well.

Thank you in advance

Dani AI

Generated

A short troubleshooting note for (and thanks to for the simple example): when a form "errors out" and no mail is sent the fault usually falls into three areas — the browser-to-script submission, the PHP script itself, or the mail subsystem on the server. Common culprits are wrong method or action on the form, missing name attributes on inputs, the processing file not being parsed as PHP (wrong extension or server config), a silent PHP syntax/runtime error, or an unconfigured local SMTP/mail setup.

Quick, safe checks to run on the server while debugging:

ini_set('display_errors', 1);
error_reporting(E_ALL);

var_dump($_POST);

This confirms whether the form data reaches the script and shows any PHP error messages. Remember to disable display_errors on production and inspect server/PHP error logs instead.

Mail-specific tips: check the boolean return from mail() and the server mail logs if available. On local/dev environments mail() often needs php.ini SMTP settings; on shared hosts mail may be restricted or flagged as spam if headers/From addresses are not correct. For reliable delivery and easier debugging, use an authenticated SMTP library such as PHPMailer rather than raw mail() (PHPMailer). The PHP manual is useful for basics: PHP forms tutorial and mail() reference.

Checklist: verify form field names and action, confirm PHP parsing and error output, test a minimal script that only dumps $_POST, then test mail delivery (or use SMTP via PHPMailer).

Recommended Answers

All 2 Replies

You could do something like this:

<?php
$Name = $_POST["Name"];
$Email = $_POST["Email"];
echo"Thank you $Name,<br/> Your question was sent and we will reply to the email address $Email";
?>

That is obviously a very simple bit of code but you can expand on that and add HTML tags to the Echo statement.

Regards,
Sam Rudge

Thanks samarudge,

but if you open my attached files... you'll see that I'm already way past that point. What I'm having a problem with, is that the form returns an error, and it doesn't send the information... I'm hoping that I'm just missing something simple, because I've been over the coding several times.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.