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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:41:41+00:00 2026-05-21T08:41:41+00:00

i have developed a simple php contact form, that’s working fine, but i am

  • 0

i have developed a simple php contact form, that’s working fine, but i am unable to format the body of the message as per my requirement, my code is given below, i am getting mail in a single line format,

where i want every information on a new line like this
“Name: Syed Sheeraz Ahmed
Contact No: 03453594552
Email: abc@abc.com
Address: R-47, Sector 9, North city.
Requirement: hello how are you”

<?php
$to = "sheery_1@hotmail.com";
$subject = "From Website Contact Form";
$name = $_REQUEST['name'] ;
$contact = $_REQUEST['contact'] ;
$address = $_REQUEST['address'] ;
$MESSAGE_BODY = "Name: ".$_POST["name"]."<br>"; 
$MESSAGE_BODY .= "Contact No: ".$_POST["contact"]."<br>"; 
$MESSAGE_BODY .= "Email: ".$_POST["email"]."<br>"; 
$MESSAGE_BODY .= "Address: ".$_POST["address"]."<br>"; 
$MESSAGE_BODY .= "Requirement: ".nl2br($_POST["message"])."<br>"; 
$message = $_REQUEST['message' + 'address' + 'contact'] ;
$from = $_REQUEST['email'] ;
$headers = "From:" . $from;
mail($to,$subject,$MESSAGE_BODY,$headers);
echo "Mail Sent.";
?> 
  • 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-21T08:41:42+00:00Added an answer on May 21, 2026 at 8:41 am

    You want a new line (\n) not an HTML line break (<br>) since your email isn’t marked as having an HTML body (and emails that have HTML bodies should really have multipart MIME bodies with both plain text and HTML versions since “HTML only” is a nice flag for spam detectors).

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

Sidebar

Related Questions

I have a simple contact form that works in every browser, except IE. It
I have developed a simple application that uses APNS. The app runs fine and
I have over 1000 clients and I developed a simple PHP script to loop
I have developed a simple location aware iPhone application which is functionally working very
I have a very simple windows Service that is developed in vb.net 2008. When
I have developed a simple site that fetches tweets from the Twitter public timeline,
I am really new to php, I have recently developed a reliability simple web
I have a developed a application that allows users to draw simple images on
I have a simple subscribe form at : http://thepanamainsider.com/sanblas/index9.php The form doesn't work, it
We have various php projects developed on windows (xampp) that need to be deployed

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.