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

  • Home
  • SEARCH
  • 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 8832957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:39:41+00:00 2026-06-14T08:39:41+00:00

Hi all this is the PHP im using: <?php $name = $_POST[‘name’]; $email =

  • 0

Hi all this is the PHP im using:

<?php
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$message = $_POST['message'];
$formcontent=" From: $name \n Phone: $phone \n Message: $message";
$recipient = "sophiec@fdb.co.uk";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!" . " -" . "<a href='contact.html' style='text-decoration:none;
color:#ff0099;'> Return Home</a>";
?>

Its working perfectly fine but i would like there to be some text sent with this email that says “This is from your website” or something similar to tell the recipient that it isnt spam (my client isn’t tech friendly and sees everything plain text as spam). I’m very new to PHP with nearly 0 knowledge and have no idea how to add something like that. I did have a go at making a new variable with the string inside and then include that in the:

mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");

line but with no success. Thanks for taking the time any help would be welcome.

  • 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-14T08:39:43+00:00Added an answer on June 14, 2026 at 8:39 am

    Change this line: $formcontent=" From: $name \n Phone: $phone \n Message: $message";

    Add the content you want:

    $formcontent="This is from your website\n From: $name \n Phone: $phone \n Message: $message";
    

    Or if you want to change the subject, this line: $subject = "Contact Form";

    Add the content you want:

    $subject = "Contact Form - From your website";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have borrowed code from this link PHP regex templating - find all occurrences
now I can make it work with user-profile.tpl.php page,all this page does is to
this is really doing my nut..... all relevant PHP Output scripts set headers (in
I found this on a website, css_loader.php <?php // First of all send css
We currently have an error catching script for all our PHP sites. This script
<?php $a="php.net s earch for in the all php.net sites this mirror only function
I am currently exporting data from php to excel using the code as below:
I'm trying to retrieve data from an api using curl with this code: $xml_data
I am using a PHP script to generate an email based on the information
I have a problem when sending a form via email using the PHP Mail

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.