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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:12:59+00:00 2026-05-31T11:12:59+00:00

I have a mail function with the standard parameters: mail($to, $subject, $message, $headers); Where:

  • 0

I have a mail function with the standard parameters:

mail($to, $subject, $message, $headers);

Where:

$headers = "From: admin@mysite.org";
$headers .= "\r\nContent-Type: multipart/alternative; boundary=\"PHP-alt-".$random_hash."\""; 

Now, I’m trying to get the sent e-mails to show ‘My Site’ as the sender instead of ‘admin@mysite.org’ but if someone responds to the mail it still needs to go to admin@mysite.org.

I’ve tried putting “My Site” in the “From” field before and after the e-mail address but it just appends to the address. I’ve tried appending it to the $headers variable but that messes the whole e-mail up. I’ve also tried adding it this way:

$headers .= "\r\nMy Site";

but that doesn’t seem to do anything.

I know this can’t be complicated as I’ve seen it done a hundred times, but I can’t seem to find a straight-forward answer for this – how do I ‘mask’ the admin e-mail with the site name but still keep it as the address any response goes to?

  • 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-31T11:13:01+00:00Added an answer on May 31, 2026 at 11:13 am

    Change your From: header to "From: My Site <admin@mysite.org>"

    $headers = "From: My Site <admin@mysite.org>";
    $headers .= "\r\nContent-Type: multipart/alternative; boundary=\"PHP-alt-".$random_hash."\"";
    

    From the PHP Docs.

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

Sidebar

Related Questions

I have a mail function $to = fahad@somewhere.com; $subject = Voucher Number: .$voucher; $message
i have used a mail function. after inserting every record simultaneously from multiple PC.
I have the following code that sends a message using the mail() function. Everything
I have a script that uses PHP mail() function to send emails: mail(me@mydomain.com, Subject,
I want to use the mail() function from my localhost. I have WAMP installed
I have a mail function that sends out an email with content from an
i have been asked the php mail() function, is it send from linux ?or
I have used default mail() function to send email it sends emails to yahoo
I have a PHP application that sends email using the pear Mail function. Unfortunately
i have function to send mail with attachment to microsoft exchange server. My problem

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.