Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How do i write a mail from a script Post 2029 by arunava_maity on Saturday 14th of April 2001 06:12:58 AM
Old 04-14-2001
Hi mib,
Thanks for ur help.I saw the document that u have refered.Most of the things i did'nt understood. By the way is there any way of writing a simple script by using mailx or mail command to achieve my job.
Thanks in advance
Cheers
arunava
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How can I write a HTML file in UNIX and sent it as a body of a mail

Hi, How can I write a HTML file in Unix. Once I do that, I want to send this file as a body of a mail, along with writing a subject for the mail I am sending through unix. How can that be done? (0 Replies)
Discussion started by: diwa81
0 Replies

2. 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

3. Shell Programming and Scripting

script to read mail on a mail server

Hi All, Is there any way Unix shell script can directly read a mail on a mail server (for eg. abc@xyz.com) and save it as a text file in a unix directory ? Thanks PRKS ---------- Post updated at 08:37 AM ---------- Previous update was at 08:36 AM ---------- I am using ksh (1 Reply)
Discussion started by: PRKS
1 Replies

4. Solaris

mail: Write error in copymt()

I hate Monday's... Sun Microsystems Inc. SunOS 5.10 Generic January 2005 You have new mail. DONE! root@bender:/> mail mail: Write error in copymt() Google seems to come up short for this error... (2 Replies)
Discussion started by: ippy98
2 Replies

5. IP Networking

read/write,write/write lock with smbclient fails

Hi, We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies

6. Shell Programming and Scripting

how to write a shellscript to send a mail alert to the website user based on license expiration time

hi, i am very much new to shell scripting i have a requirement that i have to develop a License Renewal Alert system that has to give a alert mail to the users before 30days of user account expiration, by checking expiration date of the user with the data base, this system will... (0 Replies)
Discussion started by: deepu_Shscripts
0 Replies

7. 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

8. Shell Programming and Scripting

How to write this script:- check output word and send a mail?

Hi Guys, I am not Good at scripting. I need to write a script such that if output of command shows the particular word in output then send mail to abc@compay.com -bash-3.2$ ps -ef | grep bpbkar root 6040 1 0 13:05:19 ? 0:00 bpbkar -r 2678400 -ru root -dt 47395 -to 0... (20 Replies)
Discussion started by: manalisharmabe
20 Replies

9. UNIX for Beginners Questions & Answers

How to write a UNIX script to send a mail to the respective individual users about their groups?

Hi Team, I got a requirement to send a mail to the individual users of a unix server about their respective groups. can some one help me to provide the script as I am unable to write that. I tried with below lines but I come out with errors. cat /etc/passwd | awk -F':' '{ print $1}' |... (6 Replies)
Discussion started by: harshabag
6 Replies

10. 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
binmail(1)						      General Commands Manual							binmail(1)

Name
       binmail - send or receive mail among users

Syntax
       /bin/mail [+] [-i] [person...]
       /bin/mail [+] [-i] -f file

Description
       This  is the old version 7 UNIX system mail program.  The default command is described in and its binary is in the directory The program is
       still used to actually deliver a mail message into the users system-wide mailbox ( ), however, the  reading  of	these  messages  has  been
       replaced with the program Do not remove from your system.

       The  command  with  no argument prints a user's mail, message-by-message, in last-in, first-out order; the optional argument + displays the
       mail messages in first-in, first-out order.  For each message, it reads a line from the standard input to direct  the  disposition  of  the
       message.

       Issue the following commands from the program prompt:

       <CR>		   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 command; the mail file is unchanged.

       When  persons  are  named, 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  To  denote  a recipient on a remote system, prefix person by the system name and exclamation mark.  For further
       information, see

       The program sends a message to the screen that there is mail when the user logs in.

       When is used to deliver mail, (usually calls to do this), a mailbox is created for the user in the directory if it doesn't  already  exist.
       The mailbox is created with the mode 700 so that only its owner can access it.  In addition, the directory has the mode 777 with the sticky
       bit set.  The mode is 777 so that other mail programs, notably can create the appropriate lock files to prevent another process from  writ-
       ing to the mailbox at the same time.  The sticky bit set on the directory prevents one user from unlinking another user's mailbox.

Options
       -f		   Displays mail messages contained in the specified file (next argument) in place of your mailbox file.

       -i		   Notifies mail to continue after interrupts.

Restrictions
       Race conditions sometimes result in a failure to remove a lock file.

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), uucp(1c), uux(1c), write(1), sendmail(8)

																	binmail(1)
All times are GMT -4. The time now is 02:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy