Sponsored Content
Top Forums Shell Programming and Scripting Sending mail from UNIX in courier font Post 302837695 by Yoda on Friday 26th of July 2013 01:05:12 PM
Old 07-26-2013
Use HTML TABLE to format it better. Also no need to create a temporary file, just pipe it to sendmail instead:
Code:
nawk -F, '
        BEGIN {
                print "To: sample@mail.xom"
                print "Subject: Subject"
                print "MIME-Version: 1.0"
                print "Content-Type: text/html; charset=us-ascii"
                print "Content-Disposition: inline"
                print "<HTML>"
                print "<BODY>"
                print "<TABLE BORDER=0>"
        }
        {
                printf "<TR>"
                for( i = 1; i <= NF; i++ )
                        print "<TD><FONT FACE=Courier SIZE=5>" $i "</FONT></TD>"
                print "</TR>"
        }
        END {
                print "</TABLE>"
                print "</BODY>"
                print "</HTML>"
        }
' TempTwo | /path/sendmail -t

This User Gave Thanks to Yoda For This Post:
 

10 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

font courier doesn't seem to work for me

font courier doesn't seem to work for me -- I get this when I try to use it: font courier doesn't seem to work for me (6 Replies)
Discussion started by: ropers
6 Replies

2. Shell Programming and Scripting

Sending Mail Thru Unix Script

What are all the things that should be configured in order to send a mail from Unix box. An eg. program of sending a mail will help me a lot!!!!!! Thanks in advance -Om (5 Replies)
Discussion started by: Omkumar
5 Replies

3. HP-UX

How to change font and colour in mail sent from Unix

Dear All, We have following code to send mails from unix to users. We want to see few sentences of mail in bold font or to hightlight few lines in different colours. Could you please let me know how can we do it in function construct_body. ... (3 Replies)
Discussion started by: yogichavan
3 Replies

4. UNIX for Dummies Questions & Answers

Sending mail thu unix

Hello everybody. Is it possible in unix to send a mail to my acount like (abcd@xyz.com) if yes then how ?? Thank You !! (6 Replies)
Discussion started by: hellotosatish
6 Replies

5. UNIX for Dummies Questions & Answers

sending mail from unix is failing

i am sending mails from my unix server to my mail id i used sendmail option previously it ran successfully now it is not sending mails what might be the problem this is the message i am getting in /var/mail/abcdev file how to rectify this? ----- The following addresses had permanent... (1 Reply)
Discussion started by: trichyselva
1 Replies

6. Programming

Sending mail in C/C++ in unix server

Hi Frnds, I have a task in my project wherein i have to send out a mail from my C++ code.With some file attachements.Please help me in this. At a higher level wat i can tell is my code generated 3 csv file and i have to send these files as attachement. My code is executed in unix... (6 Replies)
Discussion started by: electroon
6 Replies

7. UNIX for Dummies Questions & Answers

sending mail from unix

Hi, I am using mailx command to send mail through Unix. But I am able to send mail only within my domain. If i want to send mail to some other server, it's not working. Like say If I want to send mail to someone on gmail or yahoo it's not working. but it's working fine within my company domain.... (3 Replies)
Discussion started by: anki_1
3 Replies

8. Shell Programming and Scripting

Sending mail in unix

Dear Friends, I have a shell script where the mail is being sent like this: /usr/lib/sendmail -v ${CPA_ADMIN} CPA_ADMIN="xx@abc.com" Can we specify more than one email ids in this variable? Is ther eany limit to the number of email ids I can specify in this variable, to whom the mail... (3 Replies)
Discussion started by: Radhe
3 Replies

9. Shell Programming and Scripting

Font change in unix while sending email

Hi, I know that we would be require HTML to change the font and color of the text of the output, if we wnt to send that through the email. But I have managed to get below code, can someone look into it and let me know if i can acheive my requirement through this kind of code: Following can... (9 Replies)
Discussion started by: amit.mathur08
9 Replies

10. UNIX for Dummies Questions & Answers

Sending e-mail from unix

Hello, I want to send an email from unix. I tried following commands: mailx -s "hello" manish.xxx@xxx.com < echo_manish and echo "Testing Mail" | mailx -s "hello" manish.xxx@xxx.com but in both the commands nothing is happening. I mean it is neither giving any error nor I am receiving... (7 Replies)
Discussion started by: manishdivs
7 Replies
MIME::Field::ParamVal(3)				User Contributed Perl Documentation				  MIME::Field::ParamVal(3)

NAME
MIME::Field::ParamVal - subclass of Mail::Field, for structured MIME fields SYNOPSIS
# Create an object for a content-type field: $field = new Mail::Field 'Content-type'; # Set some attributes: $field->param('_' => 'text/html'); $field->param('charset' => 'us-ascii'); $field->param('boundary' => '---ABC---'); # Same: $field->set('_' => 'text/html', 'charset' => 'us-ascii', 'boundary' => '---ABC---'); # Get an attribute, or undefined if not present: print "no id!" if defined($field->param('id')); # Same, but use empty string for missing values: print "no id!" if ($field->paramstr('id') eq ''); # Output as string: print $field->stringify, " "; DESCRIPTION
This is an abstract superclass of most MIME fields. It handles fields with a general syntax like this: Content-Type: Message/Partial; number=2; total=3; id="oc=jpbe0M2Yt4s@thumper.bellcore.com" Comments are supported between items, like this: Content-Type: Message/Partial; (a comment) number=2 (another comment) ; (yet another comment) total=3; id="oc=jpbe0M2Yt4s@thumper.bellcore.com" PUBLIC INTERFACE
set [\%PARAMHASH | KEY=>VAL,...,KEY=>VAL] Instance method. Set this field. The paramhash should contain parameter names in all lowercase, with the special "_" parameter name signifying the "default" (unnamed) parameter for the field: # Set up to be... # # Content-type: Message/Partial; number=2; total=3; id="ocj=pbe0M2" # $conttype->set('_' => 'Message/Partial', 'number' => 2, 'total' => 3, 'id' => "ocj=pbe0M2"); Note that a single argument is taken to be a reference to a paramhash, while multiple args are taken to be the elements of the paramhash themselves. Supplying undef for a hashref, or an empty set of values, effectively clears the object. The self object is returned. parse_params STRING Class/instance utility method. Extract parameter info from a structured field, and return it as a hash reference. For example, here is a field with parameters: Content-Type: Message/Partial; number=2; total=3; id="oc=jpbe0M2Yt4s@thumper.bellcore.com" Here is how you'd extract them: $params = $class->parse_params('content-type'); if ($$params{'_'} eq 'message/partial') { $number = $$params{'number'}; $total = $$params{'total'}; $id = $$params{'id'}; } Like field names, parameter names are coerced to lowercase. The special '_' parameter means the default parameter for the field. NOTE: This has been provided as a public method to support backwards compatibility, but you probably shouldn't use it. parse STRING Class/instance method. Parse the string into the instance. Any previous information is wiped. The self object is returned. May also be used as a constructor. param PARAMNAME,[VALUE] Instance method. Return the given parameter, or undef if it isn't there. With argument, set the parameter to that VALUE. The PARAMNAME is case-insensitive. A "_" refers to the "default" parameter. paramstr PARAMNAME,[VALUE] Instance method. Like param(): return the given parameter, or empty if it isn't there. With argument, set the parameter to that VALUE. The PARAMNAME is case-insensitive. A "_" refers to the "default" parameter. stringify Instance method. Convert the field to a string, and return it. tag Instance method, abstract. Return the tag for this field. SEE ALSO
Mail::Field perl v5.18.2 2013-11-14 MIME::Field::ParamVal(3)
All times are GMT -4. The time now is 03:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy