|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to mail a html file.?
Hi,
Can anyone tell me how to mail a html file in unix? I have a HTML file which contains a table structure, and i want this table to be created in the mail body and mail it. Does anyone have any suggestions. |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Code:
echo "Content-type: text/html" > mail.html echo "FROM: Rocky<you@gmail.com>" >> mail.html echo "TO: recepient@gmail.com" >> mail.html echo "SUBJECT: Test mail" >> mail.html cat file.html >>mail.html cat mail.html | sendmail -t |
| Sponsored Links | ||
|
|
#3
|
||||
|
||||
|
MIME (Multimedia Internet Mail Extensions) allows you specify the content type of your mail. in the headers of your mail (ie before the first new line) you could specify Code:
Content-type: text/html; This will tell the mail client to render the contents as html. |
|
#4
|
|||
|
|||
|
use this Code:
CONTENT=<HTML File name> export SUBJECT="Subject Line `date` ]" ( echo "Subject: $SUBJECT" echo "MIME-Version: 1.0" echo "Content-Type: text/html" echo "Content-Disposition: inline" cat $CONTENT ) | /usr/sbin/sendmail $MAIL_LIST You can use this.. just make sure that sendmail is working
Last edited by Scott; 01-16-2013 at 04:59 AM.. Reason: Please use code tags |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| problem with sending mail from txt file having HTML code via sendmail -t | jassi10781 | Shell Programming and Scripting | 4 | 09-14-2012 06:36 AM |
| How to embed a html file in a mail sending from Linux box with uuencode or mailx? | johnveslin | Shell Programming and Scripting | 2 | 09-27-2010 06:16 PM |
| How to send html file in a mail not as an attachment but it should display in the mail in table for | mani_isha | UNIX for Dummies Questions & Answers | 0 | 03-30-2010 03:37 AM |
| How can I write a HTML file in UNIX and sent it as a body of a mail | diwa81 | Shell Programming and Scripting | 0 | 10-13-2004 09:07 PM |
| How do I tell mail (or pine, or whatever) that the piped in file is html? | Boots | Programming | 1 | 07-16-2002 02:40 AM |
|
|