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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:54:26+00:00 2026-05-27T02:54:26+00:00

I copied some PHP mailer and at some point had it working. But the

  • 0

I copied some PHP mailer and at some point had it working. But the thing is, I think it’s missing something I want specifically, I need to make the final email output display like below:

Name: [name of sender here]
Subject: [subject here]
Message: [message here]

See if the format above can be done I would like to add a company input field too at some point. here’s he php mailer below:

<?php 
//print_r($_POST);
    if(isset($_POST['_save'])) {
        $name = $_POST['name'];
        $email = $_POST['email'];
        $message = $_POST['message'];
        $subject = $_POST['subject'];

        if (empty($name) || empty($email) || empty($subject) || empty($message)) {
            if (empty($name))
                $error['name'] = "Please enter your Full Name";
            if (empty($email))
                $error['email'] = "Please enter a valid Email Address";
            if (empty($subject))
                $error['subject'] = "Please Write a Subject";
            if (empty($message))
                $error['message'] = "lease write a message, inquiries or other concerns above";
        }
        else { //if not empty

            $headers="From: {$email}\r\nReply-To: {$email}"; //create headers for email
            mail('email@domain.com',$subject,$message,$headers); //mail the message;
            $success = "Thank you! You're email has been sent.";
            #done;
        }
    }
?>
  • 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-27T02:54:26+00:00Added an answer on May 27, 2026 at 2:54 am

    For your first question, change

    mail('email@domain.com',$subject,$message,$headers);
    

    to

    $content="Name: ".$name."<br>Subject: ".$subject."<br>Message: ".$message;
    mail('email@domain.com',$subject,$content,$headers);
    

    As for your second question, as Jan states, add a company name field to your form and do exactly the same as with the name/subject/message variables.

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

Sidebar

Related Questions

I'm working on some doc file, that when copied and pasted into a text
I have written a tool for database replication in PHP. It's working fine but
Every day in my server are copied some images via ftp.I want for every
I am using PHP to generate some XML. I need to put quotes in
I copied some Delphi code from one project to another, and found that it
I have copied some files from project A to project B, both of which
I coded some calculation stuff (I copied below a really simplifed example of what
I have some 3rd party libraries and includes (I have copied them to the
I am processing some CSV file which i have copied in Bin folder of
I've got an application where some assemblies are copied to C:\Windows\assembly upon deployment under

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.