No content in the attached file when sending it via Mailx command on Solaris


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers No content in the attached file when sending it via Mailx command on Solaris
# 1  
Old 03-13-2020
No content in the attached file when sending it via Mailx command on Solaris

Hi All,

I am trying to send a file using the Mailx command but when I receive the file I am getting an empty file. Below are the commands that I am using:
Code:
uuencode /path/ MAIL new.html >> my_attachment
/usr/bin/mailx -s "Testing" -v  emailid@com< my_attachment

I get the file in the mail but when I open it , its empty, I can see the size of the file is also mentioned around 200Kb.
I am also getting a message like this in the mail body:
Code:
begin-base64 644 wombat_2020-02-24.log.

I have tried to send txt file, html file but still getting the same issue.

Moderator's Comments:
Mod Comment Please do wrap your samples/codes in CODE TAGS as per forum rules.

Last edited by rbatte1; 03-13-2020 at 09:52 AM..
# 2  
Old 03-17-2020
Is there something in the file

Just a first question, but do you know if your file from the first command actually contains anything?
You are appending to my_attachment, but that would be a first thing to look at.

As a 2nd approach, have you tried the same logic in your second line with a known text file?
Ruling out something quirky in the file you built.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problems sending an attached file with uuencode

I use uuencode in UNIX to send an attached .txt file to my e-mail. The .txt file looks like this: field_1;field_2;field_3 1;2;3 4;5;6 7;8;9 ... When the mail comes, with the attached file, it looks likt thuis: field_1;field_2;field_3 ;1;2;3 ;4;5;6 ;7;8;9 The different lines are... (3 Replies)
Discussion started by: katled
3 Replies

2. Shell Programming and Scripting

Mailx attachment not getting attached.

Hi Friends, Please help me with this problem. I have a number of split files in a directory. each split files has pdf filenames in it. pdf files are also in the same directory. I send a mail for each split files present in the directory with the pdf file mentioned in the file. I have... (4 Replies)
Discussion started by: jcebalaji
4 Replies

3. Shell Programming and Scripting

sending content of a file in Expect

How Can I send the content of a file in Expect? Do I have to use cat command in a way? if yes how? lets say my file is called 1.txt. example: expect "Enter command to send:" {send "???? \r"} ???? --> content of the file 1.txt (1 Reply)
Discussion started by: alireza6485
1 Replies

4. Shell Programming and Scripting

How to embed a html file in a mail sending from Linux box with uuencode or mailx?

How to embed a html file as subject in a mail sending from Linux box with uuencode or mailx or any other way? we do not want the file as attachment, it should be embedded in the mail subject. (2 Replies)
Discussion started by: johnveslin
2 Replies

5. Shell Programming and Scripting

mailx -s not sending the file to mail address

Hi All, OS:Red Hat Linux 4 86x64 Below is my shell script which is not sending mail to the mail recipient: #!/bin/bash export MAILLIST="xyz@yahoo.com" cd <path_to_the_script_perf_report.sql> sqlplus / as sysdba @perf_report.sql if then cat <path_to_the_script/*MONTHLY*REPORT*.lst... (6 Replies)
Discussion started by: a1_win
6 Replies

6. Shell Programming and Scripting

sending mail through mailx command

Hi I need help to send mail through mailx command . Currenlt my program is like #!/bin/ksh -x echo " " >> path.lst MAIL_LIST='someone1@gamil.com someone2@gamil.com someone3@gamil.com' cat path.lst | mailx -s "path loaction" $MAIL_LIST echo "End" exit 0 Its work fine . But i... (3 Replies)
Discussion started by: mani_isha
3 Replies

7. Shell Programming and Scripting

Referring to attached images in html email body through mailx

encoding type for images? (5 Replies)
Discussion started by: biswasbaishali
5 Replies

8. UNIX for Dummies Questions & Answers

sending mail using mailx command

Hi All, Please help me regarding sending mails using mailx command in unix. I will be glad if some one give me the sintax of this. I tried using the below but vain. mailx -s 'Hi' 'xyz@abc.com' Regards, Manas (5 Replies)
Discussion started by: manas6
5 Replies

9. Shell Programming and Scripting

mailx attachment sending large file

Hi I want to sent attachment file which is 400mb size.(single file, not tar file) is there any way that these kind of large files can be divided into small sizes and sent as attachments thanks with anticipation (3 Replies)
Discussion started by: karthikn7974
3 Replies

10. Shell Programming and Scripting

Problem with mailx command when sending attachment.

Hi, I have tried to sent a mail with body and attachment. But the shell script got hanging while executing that command. The command is "(cat body;uuencode att1.csv)|mailx -s "Production Monitoring Report(Unix Side)" milton.yesusundaram@patni.com" where body is a file having a single line.... (2 Replies)
Discussion started by: miltony
2 Replies
Login or Register to Ask a Question