Sending attachment to webmail using UNIX


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Sending attachment to webmail using UNIX
# 1  
Old 02-03-2009
Sending attachment to webmail using UNIX

Hi,

I am using Unix commands to send email with attachment from SAP. Within the organization(company email) the attachment is perfect, when I am trying to send as an web mail (yahoo) the attachment is not appearing and junk chars are coming as body.

Someone suggested that I can use MIME, but I donot know how to use, can anyone help me out with this.

Currently I am using the following command.

CONCATENATE 'uuencode' P_FNAME 'Delivery.txt' '| mailx -m -s' 'Subject' P_EMAIL
INTO UNIXCOM SEPARATED BY SPACE.

CALL 'SYSTEM' ID 'COMMAND' FIELD UNIXCOM
ID 'TAB' FIELD TABL-*SYS*.

Your promp response is highly appreciated.

Thanks
Supriya
*
# 2  
Old 02-03-2009
not sure if this will help you or not, but this is how I send attachments from unix.........

mail userr@host.com < filename.txt

this doesn't actually send as an attachment, but puts the content of the file in the body of the email, works great for me.
# 3  
Old 02-03-2009
Supriya -- the uuencode command looks okay.
I suspect that there may be something wrong with the variable P_FNAME
maybe.

Print out the value of UNIXCOM somewhere in the SAP script and
verify that it works as is, when you copy and paste and try to
execute it.

I typically use this syntax ( no -m on mailx ):

Code:
uuencode file_nm file_nm | mailx -s "here comes file_nm" user@domain.com

# 4  
Old 02-04-2009
The above command is working fine for me when I send the mail internally i.e within the company email id, but when I am trying to send it to Yahoo the attachment is coming as garbage as the body of the email .

CONCATENATE 'uuencode' P_FNAME 'Delivery.txt' '| mailx -m -s' 'Subject' P_EMAIL
INTO UNIXCOM SEPARATED BY SPACE.

Using the above command I get both the attachment and subject, the -m -s is to get both the subject and attachment within the company email address, but when I send it to yahoo its all becoming garbage.

Please give some suggestions.

Many Thanks
Supriya
# 5  
Old 02-04-2009
try the below and see if it works.

mailx -m -s "Subject" to-address << eof
`uuencode filename filename`
eof

Last edited by NewBean; 02-04-2009 at 04:01 AM.. Reason: fogot the -m option
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Need help sending attachment via mailx

Hello, I am new to the Unix thing, and I am having trouble sending attachments via shell client putty through mailx. The command I use is $ mailx -s "Subject" user@blah.com < attachment.txt but everytime I do that it would say Cannot open attachment.txt I have the file save to my computer... (5 Replies)
Discussion started by: mrobin20
5 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. Shell Programming and Scripting

sending an email with attachment

Hi, Please help me in sending an e-mail with attachment through unix mailx command is not present in our unix box. (4 Replies)
Discussion started by: dudd9
4 Replies

5. Shell Programming and Scripting

Sending Attachment using MIME in UNIX

Hi, I am using the below code for sending attachment in UNIX but only blank attachment is coming in email even the content is not coming. Please help!!! export CONTENT="${DIR}/${RUN_DATE}_mailbody.txt" export SUBJECT="Search Result for Pattern - ${1}" export ATTACH=${2} ( echo... (9 Replies)
Discussion started by: rajesshh
9 Replies

6. Shell Programming and Scripting

Sending Email with Attachment

Hi, I want to send an email with multiple attachment using uuencode and mail command. I am able to send with one attachment Ex:uuencode abc.txt abc.txt | mail test@test.com -s "Test3" Can anyone reply with syntax. Regards BS (3 Replies)
Discussion started by: balajiora
3 Replies

7. Shell Programming and Scripting

sending an attachment through email

As a part of requirement I need to send out mails with attachment from UNIX. I have to take query the Oracle DB and send the result of the query in an attachment through mail. I use the following script for the same. #!/bin/csh #!/bin/bash #!/bin/ksh ATTFILE=/folder1/test.xls cd... (1 Reply)
Discussion started by: Sgiri1
1 Replies

8. Programming

C code for Sending Email with attachment

Hi, I need the C code for Sending Email with attachment through SMTP protocol, running under linux platform. Thanks (1 Reply)
Discussion started by: Mr coder
1 Replies

9. UNIX for Dummies Questions & Answers

Issue on sending a mail with attachment using unix script ?

Issue on sending a mail with attachment using unix script ? Below is my code and is working fine and there is a issue in the attachment, the attachment file printing as a text-encripted message in the mail draft box instead of putting as a attachment (cat $msg; uuencode $attach1 in1.txt ;... (2 Replies)
Discussion started by: gksenthilkumar
2 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