[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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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 ?