Does anyone know how to change the from user when sending email using the mail command? I have looked through the man page and can not see how to do this.
We are running Redhat Linux 5.
Specify CC and BCC We can also attach a bcc and cc address within a command. To attach a bcc and cc address, use the -b and -c options, respectively. To add a bcc address, execute the command as follows: mail -s "Hello World" <recipient address> -b userto< bcc address>
The MAIL FROM command initiates a mail transfer. As an argument, MAIL FROM includes a sender mailbox (reverse-path). For some types of reporting messages like non-delivery notifications, the reverse-path may be void. Optional parameters may also be specified.
ssmtp Command You need to add a subject with the keyword “Subject”. Then you'll type the message you want to convey to the email recipient. At the end of your message press Ctrl+D (^d) for sending the email.
The mail command allows you to read or send mail. If users is left blank, it allows you to read mail. If users has a value, then it allows you send mail to those users.
You can specify any extra header you may need with -a
$mail -s "Some random subject" -a "From: [email protected]" [email protected]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With