Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 896185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:41:17+00:00 2026-05-15T14:41:17+00:00

I am trying to send an email message with data collected from an html

  • 0

I am trying to send an email message with data collected from an html form.

Here is the form:

<form action="estimate.php" action="post">
    <fieldset>
        <input type="text" name="name" value="FULL NAME" onfocus="if (this.value=='FULL NAME') this.value='';"/>
        <input type="text" name="phone" value="PHONE NUMBER" onfocus="if (this.value=='PHONE NUMBER') this.value='';"/>
        <input type="text" name="email" value="EMAIL" onfocus="if (this.value=='EMAIL') this.value='';"/>
        <input type="text" name="date" value="MOVE DATE" onfocus="if (this.value=='MOVE DATE') this.value='';"/>
        <input type="text" name="origin" value="ORIGINATING ADDRESS" onfocus="if (this.value=='ORIGINATING ADDRESS') this.value='';"/>
        <input type="text" name="destination" value="DESTINATION ADDRESS" onfocus="if (this.value=='DESTINATION ADDRESS') this.value='';"/>
        <select name="move-type">
            <option value="" selected="selected">TYPE OF MOVE</option>
            <option value="Private">Private</option>
            <option value="Commercial">Commercial</option>
        </select>
        <input id="quoteSubmit" type="image" src="_images/btn_submit.png" alt="" onmouseover="javascript:this.src='_images/btn_submit-over.png'" onmouseout="javascript:this.src='_images/btn_submit.png'"/>
    </fieldset>
</form>

Here is the PHP (which I got some help on in an earlier question posting):

<html>
<head>
<title>Contact Us</title>
</head>
<body>
<h2>Email Confirmation Page</h2>
<p>This is to prove that something is showing up.</p>
<?php # sends contents of  Free Estimate form

if (isset($_POST['submitted'])) {
$errors = array();

// Check for empty fields

$checkArray = array('name', 'email', 'date', 'origin', 'destination');
foreach($checkArray as $check) {
    if (empty($_POST[$check])) {
        $errors[] = 'Please enter your '.$check;
    } 
}

if (empty($errors)) { // everything is okay

$to = "my@email.com";

    $body = "The following Free Estimate Request has been submitted:\n

        Submitted by: {$_POST['name']}\r
        E-mail: {$_POST['email']}\r
        Phone: {$_POST['phone']}\r
        Move date {$_POST['date']}\r
        Moving from: {$_POST['origin']}\r
        Moving to: {$_POST['destination']}\r
        Move type: {$_POST['move-type']}\r;

    ";

    mail ($to, 'Free Estimate Request', $body, 'From:  '.$from);      

    // end email

} else {    
    echo '<h2>Error!</h2>
    <p class="errors">The following error(s) occurred:<br />';
    foreach ($errors as $msg) {
        echo " - $msg<br />\n";
    }
    echo '</p><p>Please go back and try again.</p><p><br /></p>';
}
};

?>
</body>
</html>

The estimate.php page shows up fine and no errors are generated, but I don’t get any emails.

Not sure what I am missing here.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T14:41:17+00:00Added an answer on May 15, 2026 at 2:41 pm

    Try sending with a simple body:

    $body = "The following Free Estimate Request has been submitted:\n";
    

    See if it sends then.

    also try a basic email:

    mail ($to, 'Free Estimate Request', 'This is my body', 'From:  '.$from);
    

    Also try changing different email address and check your junk folders.

    And ofcourse make sure there is an SMTP server running

    UPDATE:

    You may also want to:

    echo "<pre>";
    print_r($_POST);
    echo "</pre>";
    

    Add this before your isset($_POST['submitted']); Then you can check to see if it even getting that far, and you can check your post vars

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to send an email message using the .NET MailMessage class which can
I am trying to send an email from a site I am building, but
I am trying to send some data from a LINQ query in C# to
I'm trying to send email to Active Directory distribution groups. I know you can
I'm trying to send an email in Java but when I read the body
I'm trying to send an email to several recipients when a new row is
I am trying to send my dynamically created silverlight 2 page/image to a an
I'm trying to send the output to the console (or colouredconsole) ... which I'm
i'm trying to send fake keyboard input to an application that's running in a
I am trying to send an anonymous object over a web service. Is there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.