Uuencode a html file with word wrap


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Uuencode a html file with word wrap
# 1  
Old 09-16-2016
Uuencode a html file with word wrap

Hi,

I have a file myfile.txt as seen below.

Code:
Name    Age    Days
---------  -------   --------
ABC           5         23
DEF          20       120

When i cat this file into a html file and send mail, I could see the file is opened as seen below.

Code:
Name    Age    Days ---------  -------   -------- ABC           5         23 DEF          20       120

The command I am using for mailx is as seen below

cat myfile.txt | mailx -s "$(echo "Subject\nContent-Type:text/html")" to@abc.com

Please help me to get the output as the initial file without any wordwrap.
# 2  
Old 09-16-2016
If you want to send it as HTML file, you'll need to make it an HTML file, too. Why don't you send as plain ASCII?
# 3  
Old 09-16-2016
Hi,

I am trying to send some report using html and I am opening the attachment inside the html file and sending it through mail.

I can see the html file is in correct format but when i get it over mail, the word wrap issue happens.

Thanks
Jay
# 4  
Old 09-16-2016
What is "the html file ... in correct format"? Please show us.
# 5  
Old 09-16-2016
Seen is my script
Code:
#!/usr/bin/ksh

displayHeader()
{
echo "<html>"
echo "<table>"
echo "<tr> My Report Head </tr>"
echo "</table>"
echo "</html>"
}
displayHeader >> mailcontent.html

echo "<html>" >> mailcontent.html
echo "<textarea rows="200" cols="200" wrap="hard">" >> mailcontent.html
cat myfile.txt >> mailcontent.html
echo "</textarea>" >> mailcontent.html
echo "</html>"  >> mailcontent.html

cat myfile.txt | mailx -s "$(echo "Subject\nContent-Type:text/html")" to@abc.com < mailcontent.html

But the mail i receive do not have the proper format.
# 6  
Old 09-16-2016
When piping into mailx on top of redirecting its stdin, I can't tell for sure which one takes precedence, although a quick test seems to indicate it's the redirection.
Why do you cat myfile.txt into mailx when it's included in mailcontent anyhow?
A quick test with your HTML file as generated shows that it should display properly. Is it possible the problem lies on the receiving side? What be your mail client?
# 7  
Old 09-19-2016
I am sending it to outlook and lotus notes.

uuencode and redirecting the file, both comes with the word wrap issue.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Word Wrap .CSV Fils

Is there a generic method for applying word wrap to all cells for a .csv file? (6 Replies)
Discussion started by: jimmyf
6 Replies

2. Shell Programming and Scripting

Retrieve information Text/Word from HTML code using awk/sed

awk/sed newbie here. I have a HTML file and from that file and I would like to retrieve a text word. <font face=arial size=-1><li><a href=/value_for_clients/Tokyo/abc_process.txt>abc</a> NDK Version: 4.0 </li> <font face=arial size=-1><li><a... (6 Replies)
Discussion started by: sk2code
6 Replies

3. UNIX for Dummies Questions & Answers

word wrap does not work

I have an input file like this, 79 #--------------------------------------------------------------------------- 80 #- define generic contact 81 cat > ${NAGIOS_ETC}/contact-generic.cfg <<-'EOF' 82 define contact { 83 name ... (4 Replies)
Discussion started by: ramky79
4 Replies

4. UNIX for Dummies Questions & Answers

Word Wrap

When I cat a file that has several hundred characters in a line, the right hand side is truncated. How can I make everything displayed on my screen word wrap? (6 Replies)
Discussion started by: bsimon
6 Replies

5. Shell Programming and Scripting

Word count in html files

Hi does somebody know how to do a word count in a .html file? Just the text words, without all the html code. Thanks (4 Replies)
Discussion started by: louisJ
4 Replies

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

7. Shell Programming and Scripting

Word wrap with sed

Hi, I got some timetable in a file but it is all mixed up like this 01:00 hgrtwhrt #104:00 tyergethr05:00 tqqrthd qrth #107:00 qhtrhqerth10:00 qerthrthqr qtrqthr qthrrt11:00 thqrthqrthrr rthgreth #212:00 trhrthrth14:00 wrthwrtwrqrthwrthwr #2116:00 trqhthtr: rthrthr17:00 rtwhtrhwrth rthwrt... (6 Replies)
Discussion started by: stinkefisch
6 Replies

8. HP-UX

word wrap issue with grep

in my HP-Unix environment I continue to have issues seeing the whole file path when I do a grep Example: >ps -ef |grep test > /testpath/is/here/ should see: >ps -ef |grep test > /testpath/is/here/not/here/test Is there a setting to turn word wrap on/off? It works fine in our AIX... (4 Replies)
Discussion started by: bowtiextreme
4 Replies

9. Shell Programming and Scripting

Should I use sed/ grep/awk for wrap file?

Hi, This is my first time post a new thread. I have been trying to work on this for the past 2 days and could not find any good solution. I have 1 long long line ( EDI wrapped file) like below: NEW*SR*04411763447*279*278*Q~*ZR*AAV*SR*04511763460*SQ*21B37F04~HL*305*304*Q~K~SN1*1*1*SR*05511763461*... (6 Replies)
Discussion started by: vanda_25
6 Replies

10. UNIX for Dummies Questions & Answers

word wrap in vi

I am using vi to edit shell scripts, but whenever I get to the end of the line it goes to the next line, and when I run the script it considers whatever was placed onthe next line a new command...I guess this has to do with word wrap- how do I continue to write on one line? (3 Replies)
Discussion started by: dangral
3 Replies
Login or Register to Ask a Question