sending mails with attachment and also some text in mail body


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users sending mails with attachment and also some text in mail body
# 1  
Old 05-23-2006
sending mails with attachment and also some text in mail body

Hi,

Can some one help me with the syntax of the mailx that should send an attachment and also some text in the message body together.

When I am using the following syntax it is not sending the attachment but only the message body.

unix2dos -ascii $REPORTFILE | uuencode $PCFILE | mailx -s "hi" xyz@hotmail.com < note.txt

Where as REPORTFILE is the simple text file with .txt extn
PCFILE is converting the .txt into .XLS
note.txt contains the message that should be there in the message body

If I try with the following syntax it is sending the attachment without any thing in the message body.

unix2dos -ascii $REPORTFILE | uuencode $PCFILE | mailx -s "hi" xyz@hotmail.com

It is on SOLARIS

Regards
Narayana Gupta
# 2  
Old 05-23-2006
where is the decoded path name to be given to uuencode?

uuencode $PCFILE $PCFILE.decoded

search the forum
# 3  
Old 05-23-2006
The input for uuencode is 'unix2dos -ascii $REPORTFILE '
and the output is $PCFILE which is $REPORTFILE.xls
# 4  
Old 05-23-2006
Quote:
Originally Posted by guptan
The input for uuencode is 'unix2dos -ascii $REPORTFILE '
and the output is $PCFILE which is $REPORTFILE.xls
decode_pathname is must

man uuencode
# 5  
Old 05-25-2006
When I use this command

unix2dos -ascii $REPORTFILE | uuencode $PCFILE | mailx -s "hi" xyz@hotmail.com


it is working fine, it is sending the attachment but no message in the message body. I want to put some text in the message body also along with the attachment.
# 6  
Old 05-25-2006
Did you look at the FAQs ?
# 7  
Old 05-25-2006
Thanks for the reply, I will try with that.

Regards
Narayana Gupta
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Sending email with message body and attachment

Hello experts!! I am trying to send an email with message body and attachment.but i am getting any one like message body or attachment. I tried below command: (echo "subject:test";echo "MIME-Version: 1.0";echo "content-transfer-encoding:base 64";echo "content-type:txt;name=test.txt";cat... (2 Replies)
Discussion started by: Devipriya Ch
2 Replies

2. UNIX for Dummies Questions & Answers

Sending mail in UNIX with body and attachment(.txt) using sendmail command

Hi All, In my .ksh script, I am sending an email with body and attachment (.txt) using sendmail command. I am able to receive the attachement along with the body of the mail. But I am getting special characters along with the content in the .txt. Also the alignment is incorrect. Can you please... (7 Replies)
Discussion started by: KRR
7 Replies

3. UNIX for Advanced & Expert Users

Sending mail with attachment

Hi, I am using Sun solaris OS unix server I am trying to send mail with an attachment using below script cat test.txt;uuencode test.txt test.txt|mailx -s "$subject" someone@somewhere I m getting mails but with no attachment. Hence i manipulate the script as below and i am... (2 Replies)
Discussion started by: sv0081493
2 Replies

4. UNIX for Dummies Questions & Answers

Sending email with attachment and body

Hi I want to able to attach a file to a email and send it with a body the body of the email is within the "body" file, and the attachment in "atch" if i send like below it will send the email correctly /usr/sbin/sendmail me@you.com< body And when i send the attachment alone... (3 Replies)
Discussion started by: sridanu
3 Replies

5. Shell Programming and Scripting

unix mail body with attachment

How can I send mail with attachment in HP-UX I am able to send mail with specific body,but not successful while attaching a file. I am using the below command however it stuck : uuencode test.txt |mailx -s "Subject" <e-mail id> (5 Replies)
Discussion started by: gautamadak
5 Replies

6. Shell Programming and Scripting

send attachment and body in one mail using mailx

Hi, Our requirement is to send an attachment and content in a single mail. I am using the below command to send attachement. --------------------- (uuencode $exp_file $exp_file) |mailx -s "$email_subject" $EmailRecipients -------------------- I m not able to send any message in the... (4 Replies)
Discussion started by: ashwin3086
4 Replies

7. Shell Programming and Scripting

Not able to attach text in body of email while sending mail with attachment

Hi, We have been trying to send mail with attachment and it is going fine, but when we try to attach a text to the body of the email, we find that the mail is going fine with the body text but the attachment is not going through. We are using ksh. The command that is successfull without the... (6 Replies)
Discussion started by: jmathew99
6 Replies

8. AIX

Command line/Script to send E-mail with HTML body and binary attachment

I apoligize for the cross-post but I'm not getting much in the way of help in the dummies forum: I'm trying to script sending an e-mail message on an AIX 5.x server with the following requirements: 1. command line switch to specify file name containing message body in HTML format 2. command... (3 Replies)
Discussion started by: G-Man
3 Replies

9. UNIX for Dummies Questions & Answers

AIX send mail with HTML message body and a binary attachment

I'm trying to script sending an e-mail message on an AIX 5.x server with the following requirements: 1. command line switch to specify file name containing message body in HTML format 2. command line switch to specify file name of a binary attachment 3. command line or input file to specify... (4 Replies)
Discussion started by: G-Man
4 Replies

10. UNIX for Dummies Questions & Answers

Sending attachment thru a mail

Is there any way we can send file attachemnts through mails from a unix server. Does the 'mail' command have such an option ?? (1 Reply)
Discussion started by: Rohini Vijay
1 Replies
Login or Register to Ask a Question