Common Issue: Table to be displayed in mail content and not as an attachment


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Common Issue: Table to be displayed in mail content and not as an attachment
# 1  
Old 03-15-2013
HP Common Issue: Table to be displayed in mail content and not as an attachment

The requirement is to send a report from an UNIX server. I have a list of data to be shown on the report, say from database. I am using sendexchange to send mail and it always send in plain text fromat and the data displayed are not aligned properly. I have seperated all the columns with fixed width but even then I am not getting a proper alignment in the data Smilie

Here it is
  1. I am using HP-UX
  2. I have only sendexchange, mailx and mail utilities to send mails
  3. I want to show the data not as an attachment but to be in the content of the mail.
  4. Mail Contents should be,
    1. CONTENTS - Description of report
    2. TABLE
      1. Header which will have column names
      2. Rows which holds the data
Any suggestions???
# 2  
Old 03-15-2013
To make things line up, you'll need to ensure that the font used when reading your message is a fixed-width font. I don't know if you can specify what font will be used to read your message if you're not sending rich text or html. You could add a note at the start of your message saying that to see table data properly formatted, it must be viewed with a fixed width font (such as courier).
# 3  
Old 03-15-2013
@Don: Thanks for the input!

Is there some way to change the format of the mail to "Text/html" or "rich text"???
# 4  
Old 03-15-2013
Quote:
Originally Posted by PikK45
@Don: Thanks for the input!

Is there some way to change the format of the mail to "Text/html" or "rich text"???
I don't think you can just do it in the text of your message through mailx since you have to modify the message header to set the mime type of the contents. You could do it with sendmail. I've never worked with sendexchange, but the man page for it on your system may explain how to provide a mimetype of text/richtext or html for the messages you send through it.

Sorry,
Don
# 5  
Old 03-15-2013
This is what I do to specify content type and email a HTML file in HP-UX using mailx
Code:
cat email_body.html | mailx -m -s "Email Subject 
Content-type: text/html" user@domain.com

# 6  
Old 03-15-2013
Quote:
Originally Posted by Yoda
This is what I do to specify content type and email a HTML file in HP-UX using mailx
Code:
cat email_body.html | mailx -m -s "Email Subject 
Content-type: text/html" user@domain.com


Did you miss something there?? I expected that "Email Subject Content-type: text/html" would be on the subject line.

And that's what I got Smilie
# 7  
Old 03-15-2013
Quote:
Originally Posted by PikK45
Did you miss something there?? I expected that "Email Subject Content-type: text/html" would be on the subject line.
And that's what I got Smilie
That is not correct. You have to put the Content-type: text/html in next line as I posted, this is to distinguish between email subject and mime header.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Facing issues with Content-Type:application/x-download Content-Disposition:attachment

I am in the process of developing a perl cgi page. I had succeeded in developing the page but there are few errors/issues with the page. description about cgi page: My CGI page retrieves all the file names from an directory and displays the files in drop down menu for downloading the... (5 Replies)
Discussion started by: scriptscript
5 Replies

2. Shell Programming and Scripting

Represent the data in table format as in mail content

hi all, I want to Represent the data in table format in mail content sample data should be like this...but i m trying to send this table to mail using unix command...hw do i do????even i echoed the table contents ...doesnt work.... help me <table style="background-color:lightblue;">... (8 Replies)
Discussion started by: navsan
8 Replies

3. Shell Programming and Scripting

Help with duplicate common data content

Input file: #data_131 0 >content..._* 1 >content..._at_+/97.20% #data_137 0 >content..._* 1 >content..._at_+/97.20% 2 >seq..._* 3 >content..._at_+/97.20% 4 >content..._at_+/97.20% #data_141 0 >content..._* #data_150 0 >content..._* 1 >content..._at_+/97.20% 2 >seq..._* 3... (3 Replies)
Discussion started by: perl_beginner
3 Replies

4. Shell Programming and Scripting

Format of content displayed in the attachment of email

Hi, I'm facing a problem in mailing attachments using uuencode in mailx. I got to attach a couple of flatfiles. I'm able to attach and mail the files successfully. But there is a problem in the format of the flatfiles when they are received as an attachemnt. For Example : Consider... (0 Replies)
Discussion started by: Sindhuap
0 Replies

5. UNIX for Dummies Questions & Answers

How to send html file in a mail not as an attachment but it should display in the mail in table for

Hi The below script working when we are sending the html as attachment can u please guide how to send thesmae data in table form direct in the mail and not in mail attachment . cat Employee.sql SET VERIFY OFF SET PAGESIZE 200 SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON - HEAD... (0 Replies)
Discussion started by: mani_isha
0 Replies

6. Shell Programming and Scripting

Issue with mail attachment

Hi Unix Gurus, Need your help regarding a weird issue that I'm facing. I have an automated unix script that sends out PGP encrypted reports/feeds to our users as mail attahments. Every thing has been going well and all the users have no issues except one, who instead of getting the attachment,... (1 Reply)
Discussion started by: arunsoman80
1 Replies

7. UNIX for Dummies Questions & Answers

Issue on sending a mail with attachment using unix script ?

Issue on sending a mail with attachment using unix script ? Below is my code and is working fine and there is a issue in the attachment, the attachment file printing as a text-encripted message in the mail draft box instead of putting as a attachment (cat $msg; uuencode $attach1 in1.txt ;... (2 Replies)
Discussion started by: gksenthilkumar
2 Replies

8. Solaris

Comparing the common columns of a table in two files

Hi, I have two text files.The first and the 2nd file have data in the same format For e.g. The first file has BOOKS COUNT: 40 BOOKS AUTHOR1 SUM:1018 MAX:47 MIN:1 AVG:25.45 BOOKS AUTHOR3 SUM:181 MAX:48 MIN:3 AVG:18.1 Note:Read it as Table columnname sum(column) max(column) min(column)... (1 Reply)
Discussion started by: ragavhere
1 Replies

9. UNIX for Advanced & Expert Users

mailx commannd - Mail and Attachment in same mail

Hi , I am using mailx command for sending the mails. Rightnow I am sending the attachment (by using uuencode $filename) as a seperate mail.I wanna send the attachment also with the same mail. (6 Replies)
Discussion started by: sharif
6 Replies
Login or Register to Ask a Question