Sponsored Content
Operating Systems Linux Red Hat How to change sender email address in mail -s command Post 302495756 by rockf1bull on Friday 11th of February 2011 05:57:17 AM
Old 02-11-2011
How to change sender email address in mail -s command

Just having trouble trying to figure out what the option is.

When I do

mail -s "Subject" someuser@example.com

I can't seem to specify "from" or "sender" option as I need it for my task. I tried using --f or -f though it didn't work.

Can someone please tell me what other option should do the above?

Cheers everyone,
Andy

---------- Post updated at 04:27 PM ---------- Previous update was at 04:08 PM ----------

Ok I managed to get it working by using following -

Code:
mail -s "subject" mail1@server.com -- -r "from@fromserver.com"

Thanks everyone,
Andy
 

10 More Discussions You Might Find Interesting

1. AIX

Change sender e-mail address

When sending emails to the outside world, aix present itself as d_prod@production1.pdc.itercom.org. This is causing some issue with our e-mail server. So we need to change the name to d_prod@itercom.org... Does any one know how this can be accomplished? Thank you (3 Replies)
Discussion started by: cchiang12
3 Replies

2. Shell Programming and Scripting

how to know if the mailx command really sends the mail to the email address?

Hi guys, I have a question about the returning message of the mailx command. if I run a mailx command, how can I know if the email has been sent to the email address? If the email address doesn't exist, is there any error message returned? If yes, how can I get the error message? Thanks... (3 Replies)
Discussion started by: sheenshine
3 Replies

3. Shell Programming and Scripting

Sender email address has to changes

I am sending email with attachment using mail and uuencode command. Ex: (echo "$EMAIL_BODY"; uuencode $FILE ATTACH.TXT) || mail "$EMAIL_ID" -s "$EMAIL_SUB" I am getting email from "applmgr@rigelapp01.us.dell.com". I want to change this email address into... (1 Reply)
Discussion started by: balajiora
1 Replies

4. Shell Programming and Scripting

change mail sender in unix aix

Hi All, I have a ksh script, in which it sends mail successfully but from root id(root@system.com). I want it to be sent as customid@system.com. I verified man pages of mail, and found '-u userid' option. But it is failing. code snippet below: mail -s "subject" -u $customid... (7 Replies)
Discussion started by: Arunprasad
7 Replies

5. Shell Programming and Scripting

how do I change the email sender if I donot have the -r option?

Hey, after I check the man page for mail and mailx, I did not find the -r option. But, I have to change the email sender, how can I do it? Send Mode mailx address... Receive Mode mailx -e mailx mailx -f ... (0 Replies)
Discussion started by: freelong
0 Replies

6. Shell Programming and Scripting

Changing the sender Email address to Alias

Hi All, I want to change the email address of the sender to some alias for eg: FROM:noreplyecommerce@test.com needs to be changes to TEST Please help me. (3 Replies)
Discussion started by: sithara
3 Replies

7. Shell Programming and Scripting

How to change the sender's name or E-mail address in mutt command

Can any one help me in this ??? How to change sender's name or email address in Mutt command??? (4 Replies)
Discussion started by: sarathi
4 Replies

8. UNIX for Advanced & Expert Users

Mail -s help ,change the sender to correct one

Hi expert I use mail -s "hello" bruce@sohu.com <kernel-img.conf send mail, it display the sender is lyang001@lyang001-OptiPlex-9010.corp.ad..com How can I change the sender to yanglei.fage@gmail.com to default ? (1 Reply)
Discussion started by: yanglei_fage
1 Replies

9. Red Hat

How to send mail with sender mail address and name?

Hi, I am trying to send a mail using "mail" command in unix. I wanted to give sender name and sender address. I tried different options ,but still it shows only mail address(No name). mail -s "Alert mail : Nothing running !!!" $email -- -F"Mail Alert" -fno-reply@alert.com But I am getting... (4 Replies)
Discussion started by: jaggy
4 Replies

10. UNIX for Beginners Questions & Answers

Mail command not working for Long Email Address with Dashes

My company has an email user group email address name that has 35 characters in front of the @ symbol where two of them are dashes. For some reason the mail command fails to send email to this address when I invoke it from the Linux command line. I don't understand the reason for the failure. Below... (5 Replies)
Discussion started by: Phil44
5 Replies
vacation(1)						      General Commands Manual						       vacation(1)

NAME
vacation - return "I am not here" indication SYNOPSIS
alias]... login DESCRIPTION
The program returns a message to the sender of a message telling them that you are currently not reading your mail. The intended use is in a file in For example, your file might contain: which would send messages to you (assuming your login name was and reply to any messages for or The preceding is required to force direct delivery to mailbox and prevent an infinite loop through the file. The double quotes are needed to tell sendmail(1M) to treat the enclosed as a unit, rather than separate recipients. It is also important to specify the full path for the vacation program, and there must be no white space between the character and the start of the path name. No message is sent unless login or an alias supplied using the option is a substring of either the or headers of the mail. No messages from or are replied to, nor is a notification sent if a or line is included in the mail headers. Only one message per week is sent to each unique sender (at each unique host system). The people who have sent you messages are recorded in a database in the files and in your home directory. The program expects a file in your home directory, containing a message to be sent back to each sender. It should be an entire message (including headers). For example, it might say: >From: eric@ucbmonet.Berkeley.EDU (Eric Allman) Subject: I am on vacation X-Delivered-By-The-Graces-Of: The vacation program Precedence: bulk I am on vacation until July 22. If you have something urgent, please contact Joe Kalash <kalash@ucbingres.Berkeley.EDU>. --eric Header lines in this file must be left-aligned and must not be preceded by any other lines, including blank lines (see sendmail(1M)). If there is no file, uses the following file (if it exists): Otherwise, it logs an error. reads the first line from the standard input (the incoming mail message in the example file above) for a UNIX style line to determine the sender. sendmail(1M) includes this line automatically, and its absence indicates non-mail input. Options The program supports the following options: Initializes the vacation database files. This option should be used before modifying a file. Identifies another name that can legitimately appear in the line of the mail header instead of your login name. More than one option can be specified. EXTERNAL INFLUENCES
Environment Variables determines the language in which error messages are printed. DIAGNOSTICS
On error, exits with a value from and causes to report an error back to the sender of the original message. Errors such as the absence of or calling with incorrect arguments, are logged using on the system where actually runs (see syslogd(1M)). The file by default; see and syslogd(1M) for customizations) should be inspected when generates mailer error messages. Remember that if the machine is configured for shared mail, inbound mail is handled at the mail server rather than on mail client nodes. This means that diagnostics appear in the mail server's not the client's WARNINGS
Errors in the file can lead to loss of mail and infinite mail loops. Always send test mail to yourself after configuring to be sure that it is working properly. This is akin to checking telephone forwarding before leaving for an extended period, and can prevent loss of messages. Some mail recipients look for an RFC 822 compliant header in their incoming mail messages. Such recipients have to set the option to in the configuration file, AUTHOR
was developed by Eric Allman and the University of California, Berkeley. FILES
Database file. Message to send. Database file. System-wide default header and message. Dictates where error messages are recorded. SEE ALSO
sendmail(1M), syslogd(1M), ndbm(3X). vacation(1)
All times are GMT -4. The time now is 10:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy