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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:59:39+00:00 2026-06-09T11:59:39+00:00

I am trying to send an email by specifying the from option using mail.

  • 0

I am trying to send an email by specifying the from option using mail.

echo "This is the main body of the mail" | mail -s "Subject of the Email" 
recipent_address@example.com -- -f from_user@example.com

Whenever I try the above command I always get error as-

mail: Options MUST PRECEDE persons

And I didn’t get any emails. Why is it so?

And I am running SunOS

bash-3.00$ uname -a
SunOS lvsaishdc3in0001 5.10 Generic_142901-02 i86pc i386 i86pc
  • 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-09T11:59:40+00:00Added an answer on June 9, 2026 at 11:59 am

    EDIT
    Your title indicates one thing, now I see you want to pass in who the sender is. Per quote from man page below, -f doesn’t mean from.

    Why do you need to do this, your mail client and sendmail will properly set your ‘from’ header? (and please answer this by editing your question, not as a comment below 🙂 ).

    end edit

    The reason you’re getting the error message that you do get is that for almost all Unix commands (including mail) using -- indicates to the program (mail) ‘END OF OPTIONS’.

    So your -f will not be processed as you expect. Why don’t you do

    echo "This is the main body of the mail" | mail -s "Subject of the Email" \
     -f from_user@example.com recipent_address@example.com 
    

    ???

    For the two mail(*) programs I could find man-pages for online, they both have similar use for the -f option:

     -f [file]       Read messages from file instead of  mailbox.
                         If no file is specified, the mbox is used.
    

    So is that what you intend? And, to put it another way, your use of -f user@example.com doesn’t seem to make sense unless you have mailbox files named like that.

    IHTH

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

Sidebar

Related Questions

I am trying to send an email (using Outlook mail) from a jsp page.
I'm trying to send an e-mail with Codeigniter like this: $this->load->library('email'); $this->email->from(myemail@email.com); $this->email->reply_to(myemail@email.com); $this->email->to(myemail@email.com);
I am trying to send email using gmail from my mvc application. I am
I am trying to send email using Exchange 2007 from a console app using
I am trying to send email using mail() in php. I need the message
I am trying to send an email via GMail from ASP.Net using the code
I am trying to send email using apache james with this code public static
I am trying to send Email using telnet and smtp.mail.yahoo.com server. when I try
I am trying to send email using PHP mail. I get the following error:
I'm using Grails Mail plugin and trying to send email and keep getting: Error

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.