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 6775973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:58:14+00:00 2026-05-26T15:58:14+00:00

I have written the following contact form. But it is or working. Please help

  • 0

I have written the following contact form. But it is or working. Please help me ….

<?php
    if (isset($_POST['submit'])) {
        $ToEmail = 'mymail@gmail.com';
        $EmailSubject = 'Site contact form ';
        $mailheader = "From: " . $_POST["email"] . "\r\n";
        $mailheader .= "Reply-To: " . $_POST["email"] . "\r\n";
        $mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
        $MESSAGE_BODY = "Name: " . $_POST["name"] . "<br>";
        $MESSAGE_BODY .= "Email: " . $_POST["email"] . "<br>";
        $MESSAGE_BODY .= "Comment: " . nl2br($_POST["comment"]) . "<br>";
        mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) 
        or die("Failure");

        echo "<p>Your message was sent.</p>"; 
    }         
?>

<form action="index.php?page=contacts" method="post">                
    <p>Your name:<br/>
        <input name="name" type="text"  size="32">
    </p>
    <p>Email address:<br/>
        <input name="email" type="text"  size="32">
    </p>
    <p>Message:<br/>
        <textarea name="comment" cols="55" rows="8"></textarea>
    </p>
    <p>
        <input type="submit" name="Submit" value="Send">
    </p>
</form>

If you find any bug please let me know. Thanks in advance.

  • 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-26T15:58:14+00:00Added an answer on May 26, 2026 at 3:58 pm

    if mail() returns false, then your PHP isn’t configured properly. If you’re on a Windows host, you need to have valid SMTP and smtp_port settings defined in your php.ini, and the SMTP server must be up and running.

    That, or you’re passing in bad values for the ‘To:’ or other headers that the SMTP server is rejecting outright.

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

Sidebar

Related Questions

I have written following condition in .cshtml page but it is not working @if
I have written the following contact form validation script. How can I validate a
I have written the following query, but in the WHERE clause I have used
I have an old website - written in asp. The contact form uses a
i have written the following code but it is giving parse error . here
I have written following code for the client of RMI. But getting java.rmi.ConnectException: Connection
I have .Net 2.0 Windows form containing combobxes. I have written following code to
I have written following lines to click all links in fetched page but it
I have written following code to pass File1 variable to Javascript, but its not
I have written following code to attach gesture recogniser to multiple imageviews. [imageview1 setUserInteractionEnabled:YES];

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.