Send email using alias name through mailx


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Send email using alias name through mailx
# 1  
Old 04-13-2009
Send email using alias name through mailx

Hi,

My requirement is I have to send email using mailx command and the recipient of the mail should see a alias instead of email address in his mail box. The same functionality that we get when we sent email using an address book. Is this functionality possible through mailx?

I tried doing the below, but it didnt work for me. Please help me it is urgent.

hdr="To:xxxx@xxx.com\nFrom:something<xxx@xxx.com>\n\n"
emailbody="something"
echo "${hdr}${emailbody} | mailx -t -s "subject field"

Thanks in Advance.

Last edited by radoulov; 04-13-2009 at 06:25 PM.. Reason: URL tags removed
# 2  
Old 04-13-2009
Most OS support the .mailrc file. Utilize the alias feature to define what you need.

Solaris: Mail Aliases (Solaris Advanced User's Guide) - Sun Microsystems
AIX: Help -
Linux: various
# 3  
Old 04-14-2009
Hi Tpietschmann,

Actually I want to see the senders name in my mail box rather than showing the email.

for example:

if i am sending a email from vamsi@xxxxx.com to my email box. What I want to see in my mail box is "mail from vamsi krishna" not the entire vamsi@xxxx.com.

through header I am able to set the cc and bcc etc but not the from.

I hope you understand my problem.

thanks,
Vamsi K Surampalli.
# 4  
Old 04-14-2009
Try changing your header:

hdr="To:xxxx@xxx.com\nFrom: \"vamsi krishna\" <xxx@xxx.com>\n\n"
# 5  
Old 04-21-2009
Hi tpietschmann,

It didnt work for me... Smilie
Vamsi.
# 6  
Old 04-21-2009
Not sure if I understand the question/issue but why don't use the mailx -r option and set the email address there?

Ex.
echo "Hello"|mailx -r xxx@xxx.com -s "subject field" torecipient(s)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

MAILX too much time to send email

Hello, I am using heirloom-mailx on UBUNTU 11.04 to create a bash script that sends an e-mail with an attachment. The command invoked is : echo $BODY | mailx -v \ -S smtp=smtps://$smtpmailserver:465 \ -S from=$MITTENTE \ -S ssl-verify=ignore \ -S smtp-auth=login \ -S smtp-auth-user=$USER \... (8 Replies)
Discussion started by: occhiverdi1987
8 Replies

2. Red Hat

Postfix - want to send email to some non-existent user using alias

Hi, I know how to use email redirection using /etc/aliases file + postfix combination and it is working fine for existing users. The question I have is: I want to send an email to tony@server1.example.com while tony user is actually not there. Rather, I want to redirect that email to... (0 Replies)
Discussion started by: freebird8z
0 Replies

3. UNIX for Dummies Questions & Answers

Send email with attachment and body : mailx , waiting for input , signal Control D

Hi, I am trying to send email with attacment and body using "mailx" (cat body.txt; uuencode attach.txt) | mailx -s "Attachment" abc@xyz.com When i type this command, the shell is still waiting for me to enter something in standard input and press control D before it sends a mail and... (2 Replies)
Discussion started by: aliaszero
2 Replies

4. Shell Programming and Scripting

Need Syntax for mailx to send email to CC

I am trying to send email using "echo "Test Email" | mailx -s "Subject" someone@xyz.com I also want to send CC to another email address along with TO using above statement. Can anyone please help me on this. Thanks. (2 Replies)
Discussion started by: swap27
2 Replies

5. Solaris

How can i use Mailx to send email

I would like to use Mailx command, please i hope when you replay give me example. because this is very good think for me. I am New in sun Microsystems Solaris 10, i hope to give me also rules to learn Solaris easily. Thank you Joseph Shafik (8 Replies)
Discussion started by: J.shafik
8 Replies

6. UNIX for Dummies Questions & Answers

Not able to send email as CC to a ID using Mailx command in HP UX

Hey Guys, I have been trying to send a email as ccto a email ID .However it seems the -c option is not working in HP UX system. It is shooting an error as "mailx: illegal option -- c" My script isin the below manner: mailx -c EMAIL_IDS_CC# -s 'BDC reminder' -r sender@email.com... (1 Reply)
Discussion started by: rohit.shetty84
1 Replies

7. UNIX Desktop Questions & Answers

Using Mailx to send to list of email addresses

Im trying to use a shell script to send to a list of email addresses in a txt file. Here is what i have tried but it keeps sending to dead.letter... Success.ksh contains... mailx -s"Night Batch Success" 'cat /Scripts/email_addresses.txt' < /Scripts/email_body_message.txt The email body... (1 Reply)
Discussion started by: aguad3
1 Replies

8. Shell Programming and Scripting

How to send attachment to web-based email client using mailx

hi, i am trying to send mail with attachment to web-based email client like gmail.com using mailx. the problem is it is displayed in content rather than as attachment. the code i am using is as follows, uuencode test1.txt test1.txt | mailx -s "test only" aaaa@gmail.com does anyone... (1 Reply)
Discussion started by: randomcz1
1 Replies

9. Shell Programming and Scripting

Using mailx to send email to multiple users.

Hi, I am using the mailx command to send email to multple users. The command works fine when i am sending mail to a single user but when i insert multiple email ids inside the quote it does not work. All the email ids are coming from a property file.Please have a lookt at the property file and... (4 Replies)
Discussion started by: priyaksingh
4 Replies

10. UNIX for Advanced & Expert Users

Unable to send eMail from a UNIX-Host ( using mailx ) to a Outlook-email-addres(Win)

Hi A) I am able to send eMail using mailx from a UNIX ( solaris 8 ) host to my Outlook-email-ID : FName.Surname@Citigroup.com ( This is NOT my actual -eMail-ID). But in Outlook the "From :" eMail address is displayed as " usr1@unix-host1.unregistered.email.citicorp.com " .i.e the words... (2 Replies)
Discussion started by: Vetrivela
2 Replies
Login or Register to Ask a Question