Short Mail Program Help


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Short Mail Program Help
# 1  
Old 02-24-2013
Short Mail Program Help

Hi,

I have been out of the loop with my UNIX/Linux for several years and have been working mainframe. I was trying to create a short two line program to create a list of email addresses as a variable and then send the list a file. Here is what I did and I thought that is was right, but I am not getting the email:

LIST=jbr3673 mmd4143 ttg2210
mail LIST <test

Please let me know what I am forgetting, I know that it must be something very stupid, but I just don't remember, it has been several years.

Thanks in advance for any help

jbriderSmilie
# 2  
Old 02-24-2013
Pls use code tags as required by forum rules.

I assume all recipients are on your local node, so no domain part etc. of the e-mail- address is necessary.
Use $LIST to make the shell expand your variable.
This User Gave Thanks to RudiC For This Post:
# 3  
Old 02-24-2013
Thanks,

I will give it a try and let you know.

jbrider
# 4  
Old 02-24-2013
Also make sure you enclose string variable value & variable name in double quotes:
Code:
LIST="jbr3673 mmd4143 ttg2210"
mail "$LIST" < test

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Client was not authenticated to send anonymous mail during MAIL FROM (in reply to MAIL FROM comm

I am having trouble getting mail to work on a red hat server. At first I was getting this message. Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)
Discussion started by: cokedude
1 Replies

2. Programming

Help on digestion of C header files for a short program.

I found a very short but very efficient program to handle big sequence file (>30GB), but could not understand it. https://github.com/lh3/seqtk Wrote to the author but no reply, probably because the program needs comprehensive knowledge of C. Can any C expert "walk me thru" the two header files... (13 Replies)
Discussion started by: yifangt
13 Replies

3. Shell Programming and Scripting

Short program to select lines from a file based on a second file

Hello, I use UBUNTU 12.04. I want to write a short program using awk to select some lines in a file based on a second file. My first file has this format with about 400,000 lines and 47 fields: SNP1 1 12.1 SNP2 1 13.2 SNP3 1 45.2 SNP4 1 23.4 My second file has this format: SNP2 SNP3... (1 Reply)
Discussion started by: Homa
1 Replies

4. UNIX for Dummies Questions & Answers

Short Program for Checking Server date

Hi Guys, Good morning! I have a file which looks something like this: Command was launched from partition 0. ------------------------------------------------ Executing command in server server3 Thu Jan 12 11:10:39 EET 2012 ------------------------------------------------... (3 Replies)
Discussion started by: rymnd_12345
3 Replies

5. UNIX for Advanced & Expert Users

need to configure mail setting to send mail to outlook mail server

i have sun machines having solaris 9 & 10 OS . Now i need to send mail from the machines to my outlook account . I have the ip adress of OUTLOOK mail server. Now what are the setting i need to do in solaris machines so that i can use mailx or sendmail. actually i am trying to automate the high... (2 Replies)
Discussion started by: amitranjansahu
2 Replies

6. Shell Programming and Scripting

Problem using mailx instead of mail in perl program

I have a perl program that uses the mail program to send emails. It works fine but because I want to change the return address on the emails to be different I need to use mailx with the "-r" option. the problem is when I change this line to use mailx I no longer recieve "any" emails. This works... (1 Reply)
Discussion started by: kieranfoley
1 Replies

7. Solaris

how to forward mail in /var/mail/username to external mail

Dear All, Now I use solaris 10 and I try to forward mail from /var/mail/username to their external mail so what should I do? thank u in advance (2 Replies)
Discussion started by: unitipon
2 Replies

8. Programming

How to e-mail from C program ?

This works fine when typed at the Unix prompt. echo "This is body" | mail -s "This is subject" "id@domain.com") But this does not put the Subject Line in the e-mail. int MainProcess() { char cmd; sprintf( cmd, "echo %s | mail -s %s %s\n","This is body","Subject... (1 Reply)
Discussion started by: Kartheg
1 Replies

9. Shell Programming and Scripting

mail program on shell script didn't work, please advise.

Hi, everyone: I post a new thread because previous post may sink and I hope the new one can be caught by your eyes. I created a shell script and the script works fine. However, the mail program part on script didn't send email to my email box and it also didn't provide any traceable... (7 Replies)
Discussion started by: duke0001
7 Replies

10. UNIX for Dummies Questions & Answers

send mail in sh program

Hi, I have a bsh program that needs to send out mail everytime someone runs. How do I send out mail without attach any file? I only need to write one line of message. Thanks for your help! (1 Reply)
Discussion started by: whatisthis
1 Replies
Login or Register to Ask a Question