Sponsored Content
Top Forums Shell Programming and Scripting [Solved] Sending a HTML email from cli loses formatting. Post 302756121 by Yoda on Tuesday 15th of January 2013 08:36:46 AM
Old 01-15-2013
If you are trying to send an email in HTML, then you must use HTML tags to ensure proper formatting. For example if all your file content are appearing in single line, then you can insert HTML line break tag <br> after each line to avoid this:-
Code:
awk '{ print $0 "<br>"; }' filename

This User Gave Thanks to Yoda For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

formatting output in html

hello all. I was hoping someone may have an idea or two. I'm throwing together a shell script that does a lot of application and system level data collection. The idea is is you run it before/after restarting an application for later analysis. A lot of stuff is collected... resource stats,... (4 Replies)
Discussion started by: ebbtide
4 Replies

2. Shell Programming and Scripting

Displaying file in html loses format

I have a bash script to output the contents of a text file to html. Everything outputs ok, except this: ###################################################################### # # # PRIVATE/PROPRIETARY # # # # ANY UNAUTHORIZED ACCESS TO, OR MISUSE OF ABC COMPANY # # SYSTEMS OR DATA MAY... (2 Replies)
Discussion started by: numele
2 Replies

3. UNIX Desktop Questions & Answers

Grep result loses formatting

I am searching for a string in a file and then redirecting the contents in another file... however the formatting is not preserved.. Can you please help me on this ... (5 Replies)
Discussion started by: blackeyed
5 Replies

4. Shell Programming and Scripting

Sending HTML Email through mailx

Hi, I am trying to send html email using mailx like follow on sh shell (Bourne) on HP-UX: mailx -s "Test HTML output in outlook MIME-Version: 1.0 Content-Type: text/html" receiver@host.com < file.txt Content of file.txt are as follows: <html> <h2>An important link to look at!</h2>... (3 Replies)
Discussion started by: manubatham20
3 Replies

5. Shell Programming and Scripting

Using top command to email if process is exceeding 25% and sending an email alert if so

This is my first time writing a script and Im having some trouble, Im trying to use the top command to monitor processes and the amount of CPU usage they require, my aim is to get an email if a process takes over a certain percentage of CPU usage I tried grep Obviosly that hasnt worked, Any... (8 Replies)
Discussion started by: jay02
8 Replies

6. UNIX for Dummies Questions & Answers

Sending html email with html attachment

Hello, I have a script which is sending an html file as an attachment. #!/usr/bin/ksh export MAILTO="user@company.com" export CONTENT="/usr/tmp/file.html" export SUBJECT="EmailSubject" ( echo "Subject: $SUBJECT" echo "MIME-Version: 1.0" echo "Content-Type: text/html" echo... (0 Replies)
Discussion started by: sreenathkg
0 Replies

7. HP-UX

[Solved] HTML Email output issue

Hi All, I am facing issue while trying to send an HTML email using my HP-UX server. I am trying to send some color codes to be drawn in the output, but in the output the correct color is not appearing. It is appearing some shades of green all the time. I referred to w3 website for the color... (5 Replies)
Discussion started by: chpsam
5 Replies

8. Shell Programming and Scripting

Sending HTML Email

1) Can you please provide me with a best example of how to send an HTML email via mutt or mail or send email commands using bash shell. 2) I tried below but i am not able to get the variable values in the HTML email output. (cat <<-EOT <html> <head><title></title> </head> <body> <p>Hello,... (9 Replies)
Discussion started by: Ariean
9 Replies

9. Shell Programming and Scripting

HTML not coming while sending using email

echo "$1" > test.txt awk 'BEGIN{ FS="|" print "MIME-Version: 1.0" print "Content-Type: text/html" print "Content-Disposition: inline" print "<HTML>""<TABLE border="1"><TH>Heading1</TH><TH>Heading2</TH><TH>Heading3</TH>" } { printf "<TR>" for(i=1;i<=NF;i++) printf "<TD>%s</TD>", $i... (2 Replies)
Discussion started by: ATWC
2 Replies

10. Shell Programming and Scripting

HTML formatting in shellscript

I have written one script which connects to MYSQL database, fires one select query and send the results over an email, if there is any Output. But the Output which I am receiving over email is in text format. I need to get it dispalyed in tabular format to ensure better readability. Below is... (3 Replies)
Discussion started by: Sambit Sahu
3 Replies
HTML::FormatPS(3)					User Contributed Perl Documentation					 HTML::FormatPS(3)

NAME
HTML::FormatPS - Format HTML as PostScript SYNOPSIS
use HTML::TreeBuilder; $tree = HTML::TreeBuilder->new->parse_file("test.html"); use HTML::FormatPS; $formatter = HTML::FormatPS->new( FontFamily => 'Helvetica', PaperSize => 'Letter', ); print $formatter->format($tree); Or, for short: use HTML::FormatPS; print HTML::FormatPS->format_file( "test.html", 'FontFamily' => 'Helvetica', 'PaperSize' => 'Letter', ); DESCRIPTION
The HTML::FormatPS is a formatter that outputs PostScript code. Formatting of HTML tables and forms is not implemented. You might specify the following parameters when constructing the formatter object (or when calling format_file or format_string): PaperSize What kind of paper should we format for. The value can be one of these: A3, A4, A5, B4, B5, Letter, Legal, Executive, Tabloid, Statement, Folio, 10x14, Quarto. The default is "A4". PaperWidth The width of the paper, in points. Setting PaperSize also defines this value. PaperHeight The height of the paper, in points. Setting PaperSize also defines this value. LeftMargin The left margin, in points. RightMargin The right margin, in points. HorizontalMargin Both left and right margin at the same time. The default value is 4 cm. TopMargin The top margin, in points. BottomMargin The bottom margin, in points. VerticalMargin Both top and bottom margin at the same time. The default value is 2 cm, PageNo This parameter determines if we should put page numbers on the pages. The default value is true; so you have to set this value to 0 in order to suppress page numbers. (The "No" in "PageNo" means number/numero!) FontFamily This parameter specifies which family of fonts to use for the formatting. Legal values are "Courier", "Helvetica" and "Times". The default is "Times". FontScale This is a scaling factor for all the font sizes. The default value is 1. For example, if you want everything to be almost three times as large, you could set this to 2.7. If you wanted things just a bit smaller than normal, you could set it to .92. Leading This option (pronounced "ledding", not "leeding") controls how much is space between lines. This is a factor of the font size used for that line. Default is 0.1 -- so between two 12-point lines, there will be 1.2 points of space. StartPage Assuming you have PageNo on, StartPage controls what the page number of the first page will be. By default, it is 1. So if you set this to 87, the first page would say "87" on it, the next "88", and so on. NoProlog If this option is set to a true value, HTML::FormatPS will make a point of not emitting the PostScript prolog before the document. By default, this is off, meaning that HTML::FormatPS will emit the prolog. This option is of interest only to advanced users. NoTrailer If this option is set to a true value, HTML::FormatPS will make a point of not emitting the PostScript trailer at the end of the document. By default, this is off, meaning that HTML::FormatPS will emit the bit of PostScript that ends the document. This option is of interest only to advanced users. SEE ALSO
HTML::Formatter TO DO
o Support for some more character styles, notably including: strike-through, underlining, superscript, and subscript. o Support for Unicode. o Support for Win-1252 encoding, since that's what most people mean when they use characters in the range 0x80-0x9F in HTML. o And, if it's ever even reasonably possible, support for tables. I would welcome email from people who can help me out or advise me on the above. COPYRIGHT
Copyright (c) 1995-2002 Gisle Aas, and 2002- Sean M. Burke. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. AUTHOR
Current maintainer: Sean M. Burke <sburke@cpan.org> Original author: Gisle Aas <gisle@aas.no> perl v5.12.1 2004-06-02 HTML::FormatPS(3)
All times are GMT -4. The time now is 03:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy