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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:23:46+00:00 2026-06-17T09:23:46+00:00

Hello I am fairly new to PHP and do not know a lot at

  • 0

Hello I am fairly new to PHP and do not know a lot at the moment. I have modified a contact form an have come into some problems regarding the mail going straight to junk.

I assume this is for the reason that (unknown sender) keeps displaying in the email header. I would appreciate it if someone could help me correct this. The following is the code that I have implemented into the website:

<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$from = 'From: Wirral PT Enquiry'; 
$to = 'joebloggs@hotmail.com'; 
$subject = 'Wirral PT Enquiry';
$human = $_POST['human'];
$headers = "enquiry@wirralpt.co.uk";
$body = "From: $name\n E-Mail: $email\n Message:\n $message";

if ($_POST['submit']) {
    if ($name != '' && $email != '') {
        if ($human == '2') {                 
            if (mail ($to, $subject, $body, $from)) { 
            echo '<p>Your message has been sent!</p>';
            } else { 
                echo '<p>Something went wrong, go back and try again!</p>'; 
            } 
        } else if ($_POST['submit'] && $human != '4') {
            echo '<p> 1+1=2!! </p>';
        }
    } else {
        echo '<p>You need to fill everything!!</p>';
    }
} 
?>
  • 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-06-17T09:23:46+00:00Added an answer on June 17, 2026 at 9:23 am

    $from = 'From: Wirral PT Enquiry'; should contain the ‘from’ email address, not just the name:

     $from = 'From: Wirral PT Enquiry <enquiry@wirralpt.co.uk>'; 
    

    Try that?

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

Sidebar

Related Questions

Hello I have been tasked with creating a fairly complex web application in php,
Hello all im fairly new to this and may need some assistance, this is
I am fairly new to the .NET scene and have run into a small
Hello I am fairly new to python and would like to know where my
Hello i'm doing a application in php, and i have a list of items
I have some fairly generic code which uses preprocessor macros to add a certain
Let me start off by saying that I am fairly new to php. I
I fairly new to regular expressions and need some help. I need to filter
I'm fairly new to C# but have searched the web for an hour and
Hello All! I'm active in a fairly large project, but I have limited experience

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.