Need to send file through mail from Solaris


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need to send file through mail from Solaris
# 1  
Old 09-08-2013
Need to send file through mail from Solaris

I have Solaris-10 and some job is writing a log. My client needs this log file every two hour in his mail.
Usually I send manual mail through mailx command, as sendmail is configured with relay server, but I am not sure, how to attach file in a mail and set it in cronjob.
Please give me some pointer on this.
# 2  
Old 09-08-2013
Check for uuencode.

Example :
Code:
(uuencode FILENAME ATTACHNAME) | mailx -ms "Subject" mail@mail

# 3  
Old 09-08-2013
Thanks Peasant. I tried putting putting all in a script and set it up in cronjob, but I am not getting attachment mail, while I am getting mail with lot of "M" in mail body and some junk in end of mail. What am I doing wrong here ?
Code:
ATTFILE=/lmm/apps/LMBP/Team_db1129.log  # File to be attached and generally requiring encoding
SUBJECT="Test"     # Change as needed
MAILTO=first_last_name@mailx.com  # Ditto
uuencode $ATTFILE $ATTFILE | mail -ms "$SUBJECT" $MAILTO

# 4  
Old 09-08-2013
I belive you are missing the ( ... ) from my example.

Regards
Peasant.
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. Shell Programming and Scripting

Solaris Server dectects EMC dead path and send mail immediately

taus-itcapp1#powermt display dev=all Pseudo name=emcpower0a CLARiiON ID=APM00105201788 Logical device ID=60060160B2202B001094F0E0AF5CE011 state=alive; policy=CLAROpt; priority=0; queued-IOs=0; Owner: default=SP A, current=SP A Array failover mode: 1 ... (6 Replies)
Discussion started by: orafup
6 Replies

3. Solaris

Configuring send mail client in solaris 10

Dear all, We have SMTP server in our organization & i want to send e-mails from solaris machine using sendmail ... in which file i need to put the smtp server ip, username & passwd.. kindly help ....... (4 Replies)
Discussion started by: vishwanathhcl
4 Replies

4. UNIX for Dummies Questions & Answers

How to send html file in a mail not as an attachment but it should display in the mail in table for

Hi The below script working when we are sending the html as attachment can u please guide how to send thesmae data in table form direct in the mail and not in mail attachment . cat Employee.sql SET VERIFY OFF SET PAGESIZE 200 SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON - HEAD... (0 Replies)
Discussion started by: mani_isha
0 Replies

5. UNIX for Advanced & Expert Users

send attachments using send mail in Solaris

Hi All, I have a requirement to send and email of body html with an attachment. concatinating uuencode output to the mail body with mailx command works, but as my Email body is of HTML type i use sendmail. my command to send HTML body is as below: export MAILTO="recipient@domain.com"... (1 Reply)
Discussion started by: mohan_kumarcs
1 Replies

6. Shell Programming and Scripting

Unable to send mail, on sun solaris

hi experts, I m new to the sun solaris. on our OS (sun solaris 5.8) i m trying to send mail but i not getting any mail, i have tried doing following . $mailx -s "Test" sivakumars@kesd.com But no response there no error also... pls let me know: 1) How can test sending mail through... (3 Replies)
Discussion started by: saisivakumar
3 Replies

7. Shell Programming and Scripting

Pull E-mail address from file, send e-mail

Hello, I am new to perl and need to create a script that will read a file and pull a name from the file and send e-mail. How can I use the following awk statement in a perl script? grep UNIXadmins /root/mail.conf | awk '{ print $2}' and use the output to send a e-mail. Any help would... (1 Reply)
Discussion started by: DC Heard
1 Replies

8. UNIX for Dummies Questions & Answers

Can not send mail in solaris 5.9

Hi !! I'm trying to send myself a mail from my Solaris server, i had tryed with this commands: mail -s "test" irasela@yahoo.com < /monitoring/space/bitacora.txt mailx -s "test" irasela@yahoo.com < /monitoring/space/bitacora.txt sendmail -F "test" address "irasela.yahoo.com" -t... (1 Reply)
Discussion started by: irasela
1 Replies

9. Solaris

mail problems - how to send mail on solaris

Hello I am new user on solaris... I need to configure my solaris to be able to send mails... I know mailx command mailx -s hello address@address.com but I get an error... you have mail in /var/mail/root # hello... User unknown /dead.letter... Saved message in /dead.letter what... (10 Replies)
Discussion started by: amon
10 Replies

10. UNIX for Dummies Questions & Answers

Send mail to any user (@hotmail,@yahoo etc) from Solaris

Hi All, I am new to unix. I want to know what are the steps to do in order to configure a unix server (Solaris 8) to send mails to the outside world. I also want to send attachments in the mail. Thanks in advance Zing (2 Replies)
Discussion started by: zing
2 Replies
Login or Register to Ask a Question