The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
extracting a string from html file with sed or awk Ragnar157 Shell Programming and Scripting 35 09-01-2008 05:39 AM
help with splitting a html file up jeroen234 Shell Programming and Scripting 3 06-22-2008 03:26 AM
how to generate html file using script? kittusri9 Shell Programming and Scripting 2 05-25-2008 11:38 PM
How do I extract text only from html file without HTML tag los111 UNIX for Dummies Questions & Answers 4 11-28-2007 04:40 AM
Flat File to HTML randerson UNIX for Dummies Questions & Answers 2 02-09-2007 10:37 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-26-2008
Swapna173 Swapna173 is offline
Registered User
  
 

Join Date: May 2008
Posts: 23
HTML file in the mailbody

Hi Guys,

How can i send a html file in the mailbody. when i use the command
cat aa.html | mail -s "hello" abc.gmail.com

this displays the entire contents of the html file.

It doesn't display in html format.
  #2 (permalink)  
Old 08-26-2008
sb008 sb008 is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 384
Quote:
Originally Posted by Swapna173 View Post
Hi Guys,

How can i send a html file in the mailbody. when i use the command
cat aa.html | mail -s "hello" abc.gmail.com

this displays the entire contents of the html file.

It doesn't display in html format.
The "mail" command will add its own headers.

Use "sendmail" instead.
  #3 (permalink)  
Old 08-26-2008
Swapna173 Swapna173 is offline
Registered User
  
 

Join Date: May 2008
Posts: 23
i think sendmail is not configured. it's says invalid command. can i use mutt command for this.
  #4 (permalink)  
Old 08-26-2008
dajon dajon is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 3
Solution to sending html in email

The best thing you can do is look at the raw output of a HTML formatted eMail then emulate it.

Here's the basics of what I did
create the script web-email.sh with the content below
#!/usr/bin/sh
(
cat $1 | /usr/sbin/sendmail -t
)### end of script

Some caution should be observed because outlook has some weird behavior.

Keep in mind that you still need to define the sendmail To:, From:, Subject, etc which can not be in HTML format.

Example: aa.out has the contents below:

To: sombody@someplace.com
From: sombodyelse@someplace.com
Subject: HTML Email
Content-Transfer-Encoding: quoted-printable


--__________MIMEboundary__________
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

< the HTML YOU WANT to send in the BODY of the email goes here >

--__________MIMEboundary__________--

Last edited by dajon; 08-26-2008 at 11:42 AM.. Reason: completed example
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:24 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0