[SOLVED] specifying from email address while sending email
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I am trying to send an email from other email address. By default if i send an email my username@hostname goes out. I want to send an email using email id. I have centos 6.5. I tried mail command with options. Below are the ommands. but it is not working. Can anybody help please
Funny - I was just doing some testing with smarttable and reminding myself how to do this.
You can specify "sendmail" options after standard "mail" options with the "-- <options>".
So to do what you want use the mail option "-s" for the subject but then use the "sendmail" option "-f" to specify the alternate sender:
Sytnax would be:
mail -s <subject> <recipient> -- -f <sender>
(Note the "--" is followed by space THEN the "-f" - it is the "--" that tells it to use the "sendmail" options.)
No i didn't get any error
I received the email
No i am still getting an email username@hostname format
yes I examined but not getting anything in headers
I checked /var/log/maillog
Its postfix sending email
Menas thanks for your help. I just came to know the cause. I am near. I just came to know that their are couple of MTA postfix and one other . By default it is using other . I want to use postfix . Is there any command that should use the Postfix configuration . I mean is there a postfix binary that i can use to send an email with from address ?