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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:34:22+00:00 2026-05-27T03:34:22+00:00

While troubleshooting a contact form with an e-mail host they told me to use

  • 0

While troubleshooting a contact form with an e-mail host they told me to use ‘-f’ in the from address of the php mail function. What does the “-f” flag do and why would that be a fix for allowing an e-mail to be delivered? I read some of the documentation but I’m not quite clear on it.

Example code:

mail($emailAddress, $mailSubject, $mailBody, $headers, '-f ' . $mailFrom);

PS: without the “-f” it works just fine for the big e-mail hosts (hotmail, gmail, etc, but for whatever reason not for the smaller host I’m working with)

Thanks

  • 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-27T03:34:23+00:00Added an answer on May 27, 2026 at 3:34 am

    -f is a parameter to the mailer (usually sendmail). From the docs:

    The additional_parameters parameter can be used to pass additional
    flags as command line options to the program configured to be used
    when sending mail, as defined by the sendmail_path configuration
    setting. For example, this can be used to set the envelope sender
    address when using sendmail with the -f sendmail option.

    Here is the man page for sendmail, you can see what the -f option does:

    -fname           Sets the name of the ``from'' person (i.e., the sender of the
                     mail).  -f can only be used by ``trusted'' users (normally
                     root, daemon, and network) or if the person you are trying to
                     become is the same as the person you are.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While the C# spec does include a pre-processor and basic directives (#define, #if, etc),
While going through university and from following the development of SO, I've heard a
While troubleshooting a misbehavior in Spree where the product list was not paginating and
I'm currently using an SQL CONNECT statement to access a remote system. While troubleshooting,
While troubleshooting a server with very high I/O wait, I notice there is a
I'm having some problems with deploying my application and while troubleshooting, I came across
I have been troubleshooting this for a while, and I am kind of new
While troubleshooting a larger assignment for school, I found a mistake I had made,
How would you prevent a browser from timing out while a long process is
While I've seen rare cases where private inheritance was needed, I've never encountered a

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.