To send a mail with a file attached


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers To send a mail with a file attached
# 1  
Old 06-12-2007
To send a mail with a file attached

Hi,

Can anyone please tell me how to send a mail to a person in unix with a file attached. The file need to be zipped and then i want to send the mail to a person.

I know that we can able to send mail from unix using the command
mail mailaddress

to send a mail to a person with the contents of a file
mail dest < filename

But how to send a mail to a person from unix with a file(file need to be send as a zip file) attached.

Please can anyone help me on this.

Thanks in advance
# 2  
Old 06-12-2007
man zip
man uuencode
man mailx

and use search function on websites
# 3  
Old 06-12-2007
# 4  
Old 06-12-2007
man sendmail
# 5  
Old 07-12-2007
mail command with attachment

Hi,

We can send mail from unix with text file instead of attached the file using mailx command.

SUBJECT="Example for mailx command"
FILE="textfile"
MAIL_DL="yourmail@mail.com\,
mymail@mail.com"

you can the following command for send the mail with attachement.

mailx -s "$SUBJECT" "$FILE" "$MAIL_DL"
OR
cat mailx -s "$SUBJECT" "$FILE" "$MAIL_DL"

Thanks,
Siva.P
Bangalore
# 6  
Old 07-16-2007
try this

uuencode <filename> <filename> | mailx -s "Logs" <mailid>


example : "uuencode APP_LDAP.csv.gz APP_LDAP.csv.gz | mailx -s "Zipped logs" cooldude@yahoo.com"
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 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

Awk: from two file create a mail with attached error

Hi. My name is Mirko I have two file. File 1: mio@mio.it tst@test.com bye@bye.fr File 2: error 08 ffff mio@mio.it test error 05 ffff bye@bye.fr test error 11 ffff tst@test.com test error 65 ffff mio@mio.it test error 55 ffff bye@bye.fr test Examples I would like to send a mail... (2 Replies)
Discussion started by: Gionfalco01
2 Replies

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

4. Shell Programming and Scripting

Script Send Mail by Parameters avec Attached file

Hi i have a script for show the information files. ls -l how do you for to place this result in a file of text and to send it attached for e-mail. The information of the mail must be in paramentros. for example e-mail to I must write the e-mail, the subject and the motive of the mail! ... (1 Reply)
Discussion started by: krlos07
1 Replies

5. Shell Programming and Scripting

How to send mail with multiple files attached?

Hi, I would like to send a mail with multiples files attached. Until now i was doing a "find" and then a "tar" of the text files. As I need to be able to read them on a mobile device such as Blackberry for instance, i would like to send them in one single mail, but without taring them. is... (2 Replies)
Discussion started by: Pierrito
2 Replies

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

7. UNIX for Dummies Questions & Answers

How to send file in mail

Hi I want to send out a file that generate 1st of each month that have formate like this 11012008_experience_rate_log.txt Now I have setup a cronjob that usually sent this file in mail like cat /data02/transfer/*_experience_rate_log.txt | mail -s 'PICS EXP RATE Logs' lger@bd.com So how... (3 Replies)
Discussion started by: vishalpatel03
3 Replies

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

9. UNIX for Dummies Questions & Answers

Send a mail with an attachement of a file

I wanted to try sending a mail with an attachement at command prompt in unix. Some one please advise that how we can do it ? Thanks, :) (2 Replies)
Discussion started by: gaddeg
2 Replies
Login or Register to Ask a Question