I have some problem in sending an email, please help me.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting I have some problem in sending an email, please help me.
# 1  
Old 10-12-2007
I have some problem in sending an email, please help me.

Hi,

I am writing a kornshell script, once the successful completion of the script
I need to send an email with body of a text along with an attachment. But i couldnt able to send an email with both body of the text and attachment at the same time in unix. The following is the code i tried,

(cat /apps/documentum/dba/log/test1.txt ; uuencode /apps/documentum/dba/log/test.log test.log) | mailx -s "successful completion" mailaddress

If i execute the above code i am recieving an email, but the attachment also i am recieving as the body of the text in the email.


I dont know how to send both the body of the text and attachment in an email. Similarly in the email i need to change the "From" address, is it possible?

Can anyone please help me on this?

Thanks in advance
# 2  
Old 10-12-2007
try this..

cat /apps/documentum/dba/log/test1.txt | mailx -a uuencode /apps/documentum/dba/log/test.log test.log) -s "successful completion" mailaddress


where (uuencode /apps/documentum/dba/log/test.log test.log)) will get you as an attachment..

thanks,
geeko
# 3  
Old 10-12-2007
Hi,

Unfortuantely this code is not working,

cat /apps/documentum/dba/log/test1.txt | mailx -a uuencode /apps/documentum/dba/log/test.log test.log -s "successful completion" mailaddress

When i execute the above the code it says,

mailx: illegal option -- a
Usage: mailx -eiIUdFntBNHvV~ -T FILE -u USER -h hops -r address
-s SUBJECT -f FILE users


I am using Sun OS 5.8, can anyone please help me?

Thanks in advance.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sending HTML Email

1) Can you please provide me with a best example of how to send an HTML email via mutt or mail or send email commands using bash shell. 2) I tried below but i am not able to get the variable values in the HTML email output. (cat <<-EOT <html> <head><title></title> </head> <body> <p>Hello,... (9 Replies)
Discussion started by: Ariean
9 Replies

2. Shell Programming and Scripting

Using top command to email if process is exceeding 25% and sending an email alert if so

This is my first time writing a script and Im having some trouble, Im trying to use the top command to monitor processes and the amount of CPU usage they require, my aim is to get an email if a process takes over a certain percentage of CPU usage I tried grep Obviosly that hasnt worked, Any... (8 Replies)
Discussion started by: jay02
8 Replies

3. Shell Programming and Scripting

Problem with sending email(to include contents of text file)

Hello, I was using a shell script for sending contents of a text file(email.report) to different users. I was using the below command in my script to send email... cat email.report | /usr/bin/mailx -s $REQ_SUBJECT -h 5 abc@xyz.com It was working fine all these days but now all of a sudden it... (18 Replies)
Discussion started by: smarty86
18 Replies

4. Linux

sending an email

I have used an already-built ActiveX control to send email from my asp web pages. One of the parameters I fill is FromName which defines the tittle the recipient will see in the From entrance in his Inbox. Now Iīm trying to use mail to send an email from a Shell but I havenīt found the... (1 Reply)
Discussion started by: RandomAccess
1 Replies

5. Shell Programming and Scripting

Sending email from Unix

I am using the following syntax to send an e-mail from Unix (Sun OS). mail -s "hello" abc@yahoo.com But, when I click enter after typing this command, its not exiting and after a while when I give ctrl+c it creates a dead.letter file in my $HOME dir. Can anyone please tell me, if I have to... (7 Replies)
Discussion started by: rajesh8s
7 Replies

6. UNIX and Linux Applications

Sending email via syslog-ng

Hi friends I have syslog-ng installed in RHEL5 server, I make it as CEntral log for all servers in my network, Filtered by IP Now What I want to do is make it send to me an email for a specific log for one of my server, In other word when any log sent from this IP (192.168.1.1 ) For... (4 Replies)
Discussion started by: reaky
4 Replies

7. UNIX for Dummies Questions & Answers

help sending the date in an email

Hi all, I'm new to the forums. Let me start off by saying UNIX is great to use and I enjoy using it. That being said I am just learning how to use it in college and I need help with an assignment. The assignment is I have to use crontab to find out when my teacher logs in on the upcoming weekend... (2 Replies)
Discussion started by: roflmywaffle
2 Replies

8. Programming

Sending email to a User from C++

How do i send a mail to User from c++? (1 Reply)
Discussion started by: debu
1 Replies

9. UNIX for Dummies Questions & Answers

sending email

hi, is there any possiblity to send email from the command prompt, for eg i want to send alert to any mail id like /data/logs is 80% to my hotmail account , xxx@hotmail.com is this really possible,, if not, then what are the prerequistes need to do this (1 Reply)
Discussion started by: vasikaran
1 Replies

10. UNIX for Dummies Questions & Answers

Sending email

I have an Solaris 8 machine running a managment application. One of the features of this application is to configure alarm forwarding to an email undress. When i configured the application to do that, it asked me only about the recipient email address. Quesiton: how to configure my Solaris 8... (7 Replies)
Discussion started by: bcheaib
7 Replies
Login or Register to Ask a Question