05-28-2008
mail format problem:
i need to send 2 diff mail in a single script:Below the script
#!/bin/ksh
echo "enter the number"
read num
if [ $num -eq 1 ]
then
mail -s "test"
unix@yahoo.com
mail -s "test" 9886767000@nma.vodafone.in,9916138003@nma.vodafone.in
else
echo "test again"
fi
---------------------------------------------------------------
the above script is not sending 2 mails
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
When I try to use the CLI mail, I get the following error. What's wrong?
Welcome to Darwin!
% mail root
Subject: test
test
.
EOT
% /etc/mail/sendmail.cf: line 81: fileclass: cannot open /etc/mail/local-host-names: Group writable directory
Do I just need to change the... (1 Reply)
Discussion started by: chenly
1 Replies
2. Shell Programming and Scripting
Hi,
I have a script that runs off the cron and creates a report, carries out a few checks and then sends the info in a email (i'm using mailx).
To exectute the sending from the script all I do is,
cat $reportfile | mailx -s "The Subject" my.email@work.com
When I test running this... (4 Replies)
Discussion started by: nhatch
4 Replies
3. UNIX for Advanced & Expert Users
i am using a script to create a file which contains the mail to be sent.in every steo this file grts appended through out the script using several variables.now i want to convert it into html format so that the mail will have better look and feel and the font color and size can be changed.
i tried... (3 Replies)
Discussion started by: dr46014
3 Replies
4. UNIX for Dummies Questions & Answers
I have written a scripts that checks the load average of server and if it is more than 5 it send a mail describing Current Load Average and High CPU/RAM processes .
The problem is I want to send these information in html form .I have done necessary coding to do the same but whenever i try to... (7 Replies)
Discussion started by: pinga123
7 Replies
5. Shell Programming and Scripting
1.
I generated a log for the script.
log:
abc
def
ghi
ijk
If I use general (plain text) format for mail sending, it was displaying correctly with new lines where I have.
Eg:
abc
def
ghi
ijk
But I tried with HTML format using the code: (8 Replies)
Discussion started by: karumudi7
8 Replies
6. Shell Programming and Scripting
I am trying to use Linux mail command on red hat linux. It is working fine except when there is hardcoded "\n" characters in the file content i want to send. It is literally taking "\n" as text and message is not getting formatted to give newliine effect.
I am using the following command:
cat... (3 Replies)
Discussion started by: fundoo.code
3 Replies
7. Shell Programming and Scripting
Hi friends,
I have file1.txt where i am sending this file as attatment in mail using below code
uuencode file1.txt file1.txt | mail -s 'TestFile' test@test.com
but the format of the file is changing when i open in attachement.
file1.txt in unix
1|hyd|nag
2|jun|kin
... (4 Replies)
Discussion started by: i150371485
4 Replies
8. Shell Programming and Scripting
Hi Gurus,
I am working on a script that sends a text file attachment on mail from unix server to my widows outlook mail box.
When i see the text file in UNIX it is perfectly formatted but when i open the same file in the mail, it looks weird as the next line is added to the same line.
For... (10 Replies)
Discussion started by: jayadanabalan
10 Replies
9. Shell Programming and Scripting
Hi All,
I 'm trying to find a way to send my contents of a file as a body of email in the format shown below. However, the format of the contents are messed up when I receive the email.
---------------------------------------------------------------------------------------------------------... (2 Replies)
Discussion started by: shash
2 Replies
10. Shell Programming and Scripting
Hello Guys,
developing a monitoring shell script to have my queue depth count over mail .
here is the sample input file to the script which has all the queue names 1 : DISPLAY QUEUE(*) WHERE (CURDEPTH GT 0)
ZFC8409: Display Queue details.
QUEUE(QL.GVR.ATA.CACHE.01) ... (10 Replies)
Discussion started by: wims
10 Replies
BINMAIL(1) General Commands Manual BINMAIL(1)
NAME
binmail - send or receive mail among users
SYNOPSIS
/bin/mail [ + ] [ -i ] [ person ] ...
/bin/mail [ + ] [ -i ] -f file
DESCRIPTION
Note: This is the old version 7 UNIX system mail program. The default mail command is described in Mail(1), and its binary is in the
directory /usr/ucb.
mail with no argument prints a user's mail, message-by-message, in last-in, first-out order; the optional argument + displays the mail mes-
sages in first-in, first-out order. For each message, it reads a line from the standard input to direct disposition of the message.
newline
Go on to next message.
d Delete message and go on to the next.
p Print message again.
- Go back to previous message.
s [ file ] ...
Save the message in the named files (`mbox' default).
w [ file ] ...
Save the message, without a header, in the named files (`mbox' default).
m [ person ] ...
Mail the message to the named persons (yourself is default).
EOT (control-D)
Put unexamined mail back in the mailbox and stop.
q Same as EOT.
!command
Escape to the Shell to do command.
* Print a command summary.
An interrupt normally terminates the mail command; the mail file is unchanged. The optional argument -i tells mail to continue after
interrupts.
When persons are named, mail takes the standard input up to an end-of-file (or a line with just `.') and adds it to each person's `mail'
file. The message is preceded by the sender's name and a postmark. Lines that look like postmarks are prepended with `>'. A person is
usually a user name recognized by login(1). To denote a recipient on a remote system, prefix person by the system name and exclamation
mark (see uucp(1C)).
The -f option causes the named file, for example, `mbox', to be printed as if it were the mail file.
When a user logs in he is informed of the presence of mail.
FILES
/etc/passwd to identify sender and locate persons
/usr/spool/mail/* incoming mail for user *
mbox saved mail
/tmp/ma* temp file
/usr/spool/mail/*.lock lock for mail directory
dead.letter unmailable text
SEE ALSO
Mail(1), write(1), uucp(1C), uux(1C), xsend(1), sendmail(8)
BUGS
Race conditions sometimes result in a failure to remove a lock file.
Normally anybody can read your mail, unless it is sent by xsend(1). An installation can overcome this by making mail a set-user-id command
that owns the mail directory.
7th Edition April 29, 1985 BINMAIL(1)