Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Not able to generate table in email body Post 303019569 by vyomdev on Monday 2nd of July 2018 08:54:11 AM
Old 07-02-2018
Not able to generate table in email body

Below is the code snippet and I'm not able to generate the table in email, output email has nothing

Code:
if [ -f $fName ]; then
echo "File $fName exists."
awk -F "," ' BEGIN {
print "MIME-Version: 1.0"
print "Content-Type: text/html"
print "Subject: Out OF Network Fee - Portfolio Level Stats"
print "<html><body><table border=1 cellspacing=0 cellpadding=3>"
print "<tr>"
for(i=1;i<=NF;i++)
print "<td>" $i"</td>"
print  "</tr>"
} END {
print "</table></body></html>"
 } ' $fName | mailx email

Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!
Please post in an adequate forum!

Last edited by RudiC; 07-02-2018 at 10:22 AM.. Reason: Added CODE tags; moved from "Post Here to Contact Site Administrators and Moderators"
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to check body of the email

Dears, i have user called dellsh i hope to make this script when this user recieve email check the budy of the email about (StatusRequest) when i find this email contain this subject run crontab do this job (create file in my home directory called index) thanks for your attention (1 Reply)
Discussion started by: dellsh
1 Replies

2. Shell Programming and Scripting

emailing as body of email

hi all, how do i email a file in the body of an email rather than as an attachment ?? have a ksh script which i need to read a file and email as part of the body rather than an attachment. my code is : uuencode file.log | mailx -s "test" but this sends file as an attachment. ... (2 Replies)
Discussion started by: cesarNZ
2 Replies

3. Shell Programming and Scripting

The body of the Email -- mailx

Hi, I am using mailx command to send an email and i took the body of the email from a file, mailx -r gtt.org -s "Status Report " ss@org.com < $ProcessStatisticsFile but now i want to declare the body of the email in the command itself. I have tried with the following command but... (4 Replies)
Discussion started by: chinnu01
4 Replies

4. Shell Programming and Scripting

Crontab issue: getting email but with out body

I have a oracle sh script test.sh #!/bin/bash R=`sqlplus -S *****/*********@dfsdf <<ENDOFSQL set serveroutput on size unlimited; execute DBMS_SNAPSHOT.REFRESH( '"MIS_ADMIN"."MV_SURVEY_UNITS_CENSUS"','F'); execute DBMS_SNAPSHOT.REFRESH( '"MIS_ADMIN"."MV_SURVEY_UNITS_CENSUS_PART"','F');... (1 Reply)
Discussion started by: ramkia6
1 Replies

5. Shell Programming and Scripting

issue with Email Body

Hi, I have written shell program to send email as below - #!/bin/ksh filename=`ls -ltrh *.Z` echo $filename |mailx -s "FOR TESTING" rahul.b@infotech.net I am getting the email but email body is - -rw-rw-r-- 1 bahulra dba 173M Mar 22 04:37 corphist.txt.Z -rw-rw-r-- 1 bahulra dba 107M... (3 Replies)
Discussion started by: rahulbahulekar
3 Replies

6. Shell Programming and Scripting

awk print the body of an email

I have fetched a couple of emails and stored then in /fetch/mail/oracle.txt, the displayed content is Date: From: Subject: To: Content-Type: ---body ----- --------- Date: From: Subject: To: Content-Type: ----body ----- ------ Date: From: I want to retrieve the body only from... (3 Replies)
Discussion started by: maddog21
3 Replies

7. UNIX for Advanced & Expert Users

Bold letter in email body

Hi All, The below is the email text and i want few words in BOLD. I am writing the below message in to a .txt file and calling it in a function which generated email. when i run at cmd prompt it is working fine , but wehn i run a script .sh it is not working. Below is the text printing in to... (2 Replies)
Discussion started by: kiranparsha
2 Replies

8. Shell Programming and Scripting

Shell scripting unable to send the sql query data in table in body of email

I have written a shell script that calls below sql file. It is not sending the query data in table in the body of email. spool table_update.html; SELECT * FROM PROCESS_LOG_STATS where process = 'ActivateSubscription'; spool off; exit; Please use code tags next time for your code and data.... (9 Replies)
Discussion started by: Sharanakumar
9 Replies

9. Shell Programming and Scripting

HTML table in email body using C Shell

I am using Sun Solaris ver. 5.10 and trying to send an HTML table in email body using mail command in C shell script. I tried following commands:- #1 mail -m "MIME-Version: 1.0;Content-type:text/html;charset=UTF-8" receiver@mail.com < file.html #2 mail -m "Content-type: text/html;" -s "This... (4 Replies)
Discussion started by: jnrohit2k
4 Replies

10. Shell Programming and Scripting

Regarding guidance related to HTML table in email body

Hello All, I have a query here. I am sending an HTML table(which I am creating it by a call to REST API, in a LINUX box) and from there I have to send it into an email. So following are the poins on same: As data is not static so it is writing Dynamic data and creating HTML file. There is... (9 Replies)
Discussion started by: RavinderSingh13
9 Replies
Courriel::Header::ContentType(3pm)			User Contributed Perl Documentation			Courriel::Header::ContentType(3pm)

NAME
Courriel::Header::ContentType - The content type for an email part VERSION
version 0.29 SYNOPSIS
my $ct = $part->content_type(); print $ct->mime_type(); print $ct->charset(); my %attr = $ct->attributes(); while ( my ( $k, $v ) = each %attr ) { print "$k => $v "; } DESCRIPTION
This class represents the contents of a "Content-Type" header attached to an email part. Such headers always include a mime type, and may also include additional information such as a charset or other attributes. Here are some typical headers: Content-Type: text/plain; charset=utf-8 Content-Type: multipart/alternative; boundary=abcdefghijk Content-Type: image/jpeg; name="Filename.jpg" API
This class supports the following methods: Courriel::Header::ContentType->new_from_value( ... ) This takes two parameters, "name" and "value". The "name" is optional, and defaults to "Content-Type". The "value" is parsed and split up into the mime type and attributes. Courriel::Header::ContentType->new( ... ) This method creates a new object. It accepts the following parameters: o name This defaults to 'Content-Type'. o value This is the full header value. o mime_type A string like "text/plain" or "multipart/alternative". This is required. o attributes A hash reference of attributes from the header, such as a boundary, charset, etc. The keys are attribute names and the values can either be strings or Courriel::HeaderAttribute objects. Values which are strings will be inflated into objects by the constructor. This is optional, and can be an empty hash reference or omitted entirely. $ct->name() The header name, usually "Content-Type". $ct->value() The raw header value. $ct->mime_type() Returns the mime type value passed to the constructor. However, this value will be in all lower-case, regardless of the original casing passed to the constructor. $ct->charset() Returns the charset for the content type, which will be the value found in the "attributes", if one exists. $ct->attributes() Returns a hash (not a reference) of the attributes passed to the constructor. Attributes are Courriel::HeaderAttribute objects. The keys of the hash are all lower case, though the original casing is preserved in the "name()" returned by the Courriel::HeaderAttribute object. $ct->is_binary() Returns true unless the attachment looks like text data. Currently, this means that is has a charset defined and the charset is not "binary". $ct->attribute($key) Given a key, returns the named Courriel::HeaderAttribute object. Obviously, this value can be "undef" if the attribute doesn't exist. Name lookup is case-insensitive. $ct->attribute_value($key) Given a key, returns the named attribute's value as a string. Obviously, this value can be "undef" if the attribute doesn't exist. Name lookup is case-insensitive. The attribute is a Courriel::HeaderAttribute object. $ct->as_header_value() Returns the object as a string suitable for a header value (but not folded). Note that this uses the original casing of the mime type as passed to the constructor. EXTENDS
This class extends Courriel::Header. ROLES
This class does the Courriel::Role::HeaderWithAttributes role. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT AND LICENSE
This software is Copyright (c) 2012 by Dave Rolsky. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) perl v5.14.2 2012-03-07 Courriel::Header::ContentType(3pm)
All times are GMT -4. The time now is 08:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy