unix mail body with attachment


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting unix mail body with attachment
# 1  
Old 07-14-2010
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>
# 2  
Old 07-14-2010
Code:
uuencode file.txt file.txt | mailx -s "subject" me@my.com

PLEASE: next time search the forums. Thanks.
# 3  
Old 07-14-2010
Code:
ux2dos test.txt | uuencode myattach.txt | mailx -m -s "Subject" myemail@domain.com

The "-m" switch is important. It came up on another post earlier.

The second parameter to "uuencode" is not required because output is to a pipe.
# 4  
Old 07-14-2010
I already searched in forums, but no luck....this time too am getting the below msg in mail body without attachment:

begin 644 file.txt
I:&5L;&\*"E1H:7,@:7,@;6%I;"!";V1Y+@H)=&%B"@ET86(*16YD"@H`
`
end

I used uuencode file.txt file.txt | mailx -s "subject" <mymailid>
# 5  
Old 07-14-2010
Try my version in post #3.
# 6  
Old 07-14-2010
Thanks Methyl it is working fine...now i want to write the mail body alongwith attachment....I am using the below command but body is blank:

echo "hello" ; ux2dos test.txt | uuencode myattach.txt | mailx -m -s "Subject" <my mail_id>

---------- Post updated at 01:31 PM ---------- Previous update was at 01:25 PM ----------

I used the below...it is working fine...
ux2dos test.txt | uuencode myattach.txt | mailx -m -s "Subject" my@id <test.txt
Thanks guys for quick help

---------- Post updated at 01:36 PM ---------- Previous update was at 01:31 PM ----------

No I was wrong using the below command i am getting body only:

ux2dos test.txt | uuencode myattach.txt | mailx -m -s "Subject" my@id <test.txt
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need syntax for mailing in UNIX by using html file as body and along with attachment

Hi All, I need a syntax for mailing in unix by using html code file output as body and along with attachment (without using mutt command) HTML code file : html1.txt Attachment : attach1.txt I was using the below codes but they are not working. ( cat html1.txt ; uuencode attach1.txt... (4 Replies)
Discussion started by: Rokkesh
4 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. 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

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

5. Shell Programming and Scripting

Mail attachment with unix mail

Hi Could someone help me with the details on how to send an attachment through mail in unix. I have an html file in my unix machine and I want this to be send to some mail id, plese help with the steps. Regards Ajay (2 Replies)
Discussion started by: ajaykumarboyana
2 Replies

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

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

8. UNIX for Dummies Questions & Answers

attachment in unix mail

how to attach any file to send in a mail in UNIX (1 Reply)
Discussion started by: arpitk
1 Replies

9. UNIX for Advanced & Expert Users

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... (7 Replies)
Discussion started by: guptan
7 Replies

10. Shell Programming and Scripting

How can I write a HTML file in UNIX and sent it as a body of a mail

Hi, How can I write a HTML file in Unix. Once I do that, I want to send this file as a body of a mail, along with writing a subject for the mail I am sending through unix. How can that be done? (0 Replies)
Discussion started by: diwa81
0 Replies
Login or Register to Ask a Question