Formatting not preserved when using mailx


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Formatting not preserved when using mailx
# 1  
Old 09-16-2012
Formatting not preserved when using mailx

I tried to send email through mailx, the text file is well formatted when i open in unix, but when received the mail in outlook, the column do not align with the heading. The text file contain the tablespace details which I spool out from database.
Please advise. Do I need to specify any parameter when using mailx?
Smilie

Moderator's Comments:
Mod Comment edit by bakunin: changed title to something descriptive

Last edited by bakunin; 09-17-2012 at 06:00 AM..
# 2  
Old 09-17-2012
I too had faced this problem before - a problem caused because of platform differences. In my case, I was not keen on having the formatting preserved. So, just for better readability, I had the file double-spaced ( sed -i G file.txt ) before emailing it. Worked fine in my case.
# 3  
Old 09-17-2012
I use ..(mailx is not working for my machineSmilie)
Code:
/bin/mail -s "$SUBJECT" "$EMAIL" < file.txt

And before sending the file i just format the file as per my requirement. And i got the same file at my other end.

Tried with sendmail aslo it works perfect for me.
Code:
cat file.txt | /usr/lib/sendmail "$EMAIL"

# 4  
Old 09-17-2012
You get a useless use of cat award

sendmail, or any other shell command, does not need cat's help to read a single file.

Code:
/usr/lib/sendmail "$EMAIL" < file.txt

# 5  
Old 09-17-2012
Well, this is far off the original question. I tend to agree with @balajesuri assuming platform differences. Could you pls provide the input file and what it became on the receiving side?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Mail/mailx ignores newline formatting Problem.

I have a file hello.txt which i wish to send as a email body (not attachment). cat -ev hello.txt 1$ 2$ 3$ I use the following command to send the hello.txt as the email body. mailx -s "Alert" myteam@mycomp.com<hello.txt However, the email received has this in the email body 123... (2 Replies)
Discussion started by: mohtashims
2 Replies

2. Shell Programming and Scripting

Formatting for mailx command

Hello all, I am trying to send an email using mailx command. I have a txt file which has formatting like: root@machine# cat /export/home/test/summary.txt T A P O U T - R A T I N G - A U D I T - S U M M A R Y - R E P O... (2 Replies)
Discussion started by: Junaid Subhani
2 Replies

3. Shell Programming and Scripting

Help with Mailx

Hi , I have written below code to send email from unix. The code is getting executed fine but i am not receiving any e mail . I am not sure what is going wrong . Do we need to do any configration setting before using Mailx? Please help set -vx echo 'Sending Mail' mailx -s "SEPA_TEST"... (2 Replies)
Discussion started by: Chandru_Raj
2 Replies

4. UNIX for Dummies Questions & Answers

need help with mailx

Hi Gurus, I have a solaris zone. I am finding a issue in the situation below. When I tried to send a mail in this format its failing. : mailx -s "test mail f" xxxxxx@yy.com But its working just fine if I use echo. echo "test body"|mailx -s "test mail " xxxxxxx@yy.com Is there... (1 Reply)
Discussion started by: rama krishna
1 Replies

5. Linux

Mailx

We have configured mailx Linux server. When send mail from Linux server it is not going How to trouble shoot the root cause step by step (3 Replies)
Discussion started by: pmsuper
3 Replies

6. Shell Programming and Scripting

Mailx: How to send a attachment using mailx command

Hi All, Can anyone please provide the command for sending an mail with attachment using mailx command. Thanks in Advance :) Regards, Siram. (3 Replies)
Discussion started by: Sriram.Vedula53
3 Replies

7. Shell Programming and Scripting

process ma.gnolia_bookmarks for Diigo so that multiwords tags are preserved

Hi everyone. I was lucky enough to backup all my bookmarks last xmas before the recent complete meltdown of ma.gnolia.com Unfortunately, when submitting the file to my new diigo account, all multiword tags are converted to multiple single word tags which is not very helpful for anyone... (14 Replies)
Discussion started by: jeunium
14 Replies

8. UNIX for Dummies Questions & Answers

mailx error message : mailx: NUL changed to @

If I use the "Mail" link instead of the "mail" link to ../mailx I get this error. Mail so-n-so @whatever.com mailx: NUL changed to @ Unknown command: "postmaster" The email still goes through but i get the error. If I use "mail" it goes thru without the error. Any ideas?? (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies

9. UNIX for Dummies Questions & Answers

Help with mailx

I want to send a message with an attachment from Unix using the following command: uuencode $DIRNAME/$FILENAME1 | mailx -s "test subject" xyz@xyz I need to attach the file and I also want a simple message body like "there is an error. Please check it". Do I need to have this message body... (1 Reply)
Discussion started by: ssmith001
1 Replies

10. UNIX for Dummies Questions & Answers

Need help with mailx

How can I send a file of Unix usernames to everyone on the file without making an alias in my .mailrc file? Using a mailx command. Thanks, J.J. (2 Replies)
Discussion started by: JJJ
2 Replies
Login or Register to Ask a Question