sending mail from a script


 
Thread Tools Search this Thread
Operating Systems HP-UX sending mail from a script
# 1  
Old 12-12-2006
sending mail from a script

Hi

I want to send a mail (to my id like abc@xyz.com) from a shell script running on HP Ux.
Would like to include text from a file or include the file as attachment, either ways.

Thanks
Sidhu
# 2  
Old 12-12-2006
Code:
cat yourfile.log | mail -s "This is a subject" abc@xyz.com

# 3  
Old 01-02-2007
Quote:
Originally Posted by Amardeep
Hi

I want to send a mail (to my id like abc@xyz.com) from a shell script running on HP Ux.
Would like to include text from a file or include the file as attachment, either ways.

Thanks
Sidhu

Take a look at the mailx command. I use it to send logfiles to my workstation from the servers every day.
# 4  
Old 01-03-2007
search

Search the forums.
# 5  
Old 01-04-2007
mailx and mutt work great...lots-o-info in archives.
# 6  
Old 01-06-2007
can anyone give a example for this commands. say i have a file called mail_body.txt i want to send a subject stating "service is up" and the content should be taken from mail_body.txt to a recipient named krish.v@gmail.com

Please give an example with the above scenario..because i tried with the above scenario but am not getting it properly. please help.
# 7  
Old 01-08-2007
see this

Code:
mailx -s "server is up" abc@site.com <mail_body.txt

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script for sending notification mail

hi all, needed a script to send a notfication mail if the specified folder had the copy of the files that are older than 15 days i.ee for example my folder name is SAi and the files are as follows sai.txt copyofsai.txt copyofcopyofsai.txt hemanth.txt copyofcopyofhemanth.txt... (4 Replies)
Discussion started by: hemanthsaikumar
4 Replies

2. Shell Programming and Scripting

[Fixed Itself!] Sending mail form script using sSMTP does not work

I have installed sSMTP and set it up to use my gmail. Sending from cli does work fine: msg file:From: test@gmail.com To test2@gmail.com Subject: test post This is a test Executing from console:ssmtp -t < msg does work fine. But from script it does not work:#!/bin/sh ssmtp -t < msg... (0 Replies)
Discussion started by: Jotne
0 Replies

3. Shell Programming and Scripting

Sending Mail via shell script

I am in need of a script that will send out emails while going through a NAT. What I have that works is as follows: display_remote_IP | sort | uniq | while read i do FOUND=0 for IP in `echo $ACCEPTABLEIP` do if ; then FOUND=1... (2 Replies)
Discussion started by: ldapguy
2 Replies

4. Shell Programming and Scripting

Sending mail from shell script

Hello All, I m trying to send mail from my unix script, I have used the below command mailx -s 'hi' email address < temp.txt It is not giving me any error,but I couldn't receive the mail Can you please help me. Many Thanks, Pragyan (6 Replies)
Discussion started by: prarat
6 Replies

5. Shell Programming and Scripting

shell script not sending mail

Hi, I have shell script which checks the filesystem check but does not send the mail. I might be missing something very simple.. could you please help? #!/bin/sh _servers="machine name" _out="/tmp/output.$$" _email="me@there.com" _sub="Disk Space Report $(date)" _mail=/usr/bin/mail... (5 Replies)
Discussion started by: Pandee
5 Replies

6. Shell Programming and Scripting

Shell script for creating log file and sending mail?

Hi , I am trying to create shell script which will help me to compare file name in two folder. There is a multiple file store in 2 folder.I want to compare that with the name. If all the file are same then send a mail that "all date is same" if not then create one log file which contain... (4 Replies)
Discussion started by: san_dy123
4 Replies

7. UNIX for Dummies Questions & Answers

Sending a mail from unix script doubt

HI i usually send an a file attachment in a mail from unix like following. mailx -s 'Job Success' someoner@gmail.com < attachment.log But I have observed in several threads that we can also use uuencode and uudecode. What are they? when should we use uudecode and uuencode ... (1 Reply)
Discussion started by: rajesh_tns
1 Replies

8. Shell Programming and Scripting

sending a mail using shell script

Please help me in writing the script for sending an attachment through email.(For example my text file name is :abc.txt and it is in directory d:/abc) (1 Reply)
Discussion started by: anitha126
1 Replies

9. UNIX for Dummies Questions & Answers

Issue on sending a mail with attachment using unix script ?

Issue on sending a mail with attachment using unix script ? Below is my code and is working fine and there is a issue in the attachment, the attachment file printing as a text-encripted message in the mail draft box instead of putting as a attachment (cat $msg; uuencode $attach1 in1.txt ;... (2 Replies)
Discussion started by: gksenthilkumar
2 Replies

10. Shell Programming and Scripting

Sending Mail Thru Unix Script

What are all the things that should be configured in order to send a mail from Unix box. An eg. program of sending a mail will help me a lot!!!!!! Thanks in advance -Om (5 Replies)
Discussion started by: Omkumar
5 Replies
Login or Register to Ask a Question