Visit Our UNIX and Linux User Community

Top Forums Programming How do I tell mail (or pine, or whatever) that the piped in file is html? Post 24634 by Boots on Tuesday 16th of July 2002 01:20:15 AM
Old 07-16-2002
How do I tell mail (or pine, or whatever) that the piped in file is html?

I'm writting a cron job and first it generates a HTML file, then grabs a list of email addresses and fires them to the people...
I've been testing with the command line using: mail -s Subject < file.html

But once I look at it, it comes through as plain text not html. I've added a <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> as the first line of my html file and still no go.

Is there some kind of command line flag to specify the file's mime type?


At this point I have some sample code that should allow me to talk straight to the SMTP daemon via sockets, and through some telnet testing it looks like I have the mail headers down for sending the file as html to multiple recipients.

Thanks in advance.
Test Your Knowledge in Computers #255
Difficulty: Easy
The consumer version of Mac OS X was launched in 2001 with Mac OS X 10.0.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How can I write a HTML file in UNIX and sent it as a body of a mail

Hi, How can I write a HTML file in Unix. Once I do that, I want to send this file as a body of a mail, along with writing a subject for the mail I am sending through unix. How can that be done? (0 Replies)
Discussion started by: diwa81
0 Replies

2. Shell Programming and Scripting

mail: html content

hi guys, am required to prepare a report and mail it, to make it more appealing :p i wish to have content of mail in rich text format i.e html type with mailx how to specify the content type of mail body as html? Thanks in advance!!! rishi (2 Replies)
Discussion started by: RishiPahuja
2 Replies

3. UNIX for Advanced & Expert Users

Mail x to HTML

Hi, i've build a script, 1: neon_script and the other 2:neon_mailing those to scripts i run with 3:neon_handmatig After that i get a mail in plain text in my mail box and i want it in html format. I already tried already a several things but nothings seems to work. Somebody got i idea how... (3 Replies)
Discussion started by: Rensen
3 Replies

4. 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

5. Shell Programming and Scripting

How to embed a html file in a mail sending from Linux box with uuencode or mailx?

How to embed a html file as subject in a mail sending from Linux box with uuencode or mailx or any other way? we do not want the file as attachment, it should be embedded in the mail subject. (2 Replies)
Discussion started by: johnveslin
2 Replies

6. UNIX for Dummies Questions & Answers

Forwarding mail via Pine

I am asking about my work account, running Linux on a system server. On pine, I set up a forward to another email account. I also keep a copy in the original account. The forward has been running fine for some time. I believe the system sends the mail first to the forwarded account and then puts... (0 Replies)
Discussion started by: BLabel
0 Replies

7. Shell Programming and Scripting

problem with sending mail from txt file having HTML code via sendmail -t

Hi, i have the following code in shell named as #!/bin/sh . /home/<user>/.profile export dt=`date "+%d%b%y"` export tim=`date "+%d%b%y %HM:%MM"` cd export WD=`pwd` SID="<sid>" export SID export ORACLE_SID=$SID export ORACLE_HOME=/oracle/$SID/102_64 export... (4 Replies)
Discussion started by: jassi10781
4 Replies

8. Shell Programming and Scripting

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. (3 Replies)
Discussion started by: rocky88
3 Replies

9. Shell Programming and Scripting

HTML mail formating in UNIX

Hi i need to send mail from my Unix server i used the below code. From: TTS.OO.Monitoring.Operations Subject: Error X-Mailer: htmlmail 1.0 Mime-Version: 1.0 Content-Type: text/html; charset=US-ASCII <HTML><head><style type='text/css'> table.altrowstable { font-family:... (6 Replies)
Discussion started by: mohanalakshmi
6 Replies

10. Shell Programming and Scripting

HTML mail with Attachment

Hi, I am using the below code: #!/bin/ksh SUBJ="Send mail from Unix with file attachments" ( cat << ! To : ${TO} Subject : ${SUBJ} Cc : ${CC} ! cat << ! MIME-Version: 1.0 Content-Type: text/html `cat... (1 Reply)
Discussion started by: sudvishw
1 Replies
envelopes(5)                                                    File Formats Manual                                                   envelopes(5)

envelopes - sender/recipient lists attached to messages INTRODUCTION
Electronic mail messages are delivered in envelopes. An envelope lists a sender and one or more recipients. Usually these envelope addresses are the same as the addresses listed in the mes- sage header: (envelope) from djb to root From: djb To: root In more complicated situations, though, the envelope addresses may differ from the header addresses. ENVELOPE EXAMPLES
When a message is delivered to several people at different locations, it is first photocopied and placed into several envelopes: (envelope) from djb to root From: djb Copy #1 of message To: root, (envelope) from djb to From: djb Copy #2 of message To: root, When a message is delivered to several people at the same location, the sender doesn't have to photocopy it. He can instead stuff it into one envelope with several addresses; the recipients will make the photocopy: (envelope) from djb to, From: djb To:,, joe, frde Bounced mail is sent back to the envelope sender address. The bounced mail doesn't list an envelope sender, so bounce loops are impossi- ble: (envelope) from <> to djb From: MAILER-DAEMON To: djb Subject: unknown user frde The recipient of a message may make another copy and forward it in a new envelope: (envelope) from djb to joe From: djb Original message To: joe (envelope) from joe to fred From: djb Forwarded message To: joe A mailing list works almost the same way: (envelope) from djb to sos-list From: djb Original message To: sos-list (envelope) from sos-owner to From: djb Forwarded message To: sos-list to recipient #1 (envelope) from sos-owner to frde From: djb Forwarded message To: sos-list to recipient #2 Notice that the mailing list is set up to replace the envelope sender with something new, sos-owner. So bounces will come back to sos- owner: (envelope) from <> to sos-owner From: MAILER-DAEMON To: sos-owner Subject: unknown user frde It's a good idea to set up an extra address, sos-owner, like this: the original envelope sender (djb) has no way to fix bad sos-list addresses, and of course bounces must not be sent to sos-list itself. HOW ENVELOPE ADDRESSES ARE STORED
Envelope sender and envelope recipient addresses are transmitted and recorded in several ways. When a user injects mail through qmail-inject, he can supply a Return-Path line or a -f option for the envelope sender; by default the envelope sender is his login name. The envelope recipient addresses can be taken from the command line or from various header fields, depending on the options to qmail-inject. Similar comments apply to sendmail. When a message is transferred from one machine to another through SMTP, the envelope sender is given in a MAIL FROM command, the envelope recipients are given in RCPT TO commands, and the message is supplied separately by a DATA command. When a message is delivered by qmail to a single local recipient, qmail-local records the recipient in Delivered-To and the envelope sender in Return-Path. It uses Delivered-To to detect mail forwarding loops. sendmail normally records the envelope sender in Return-Path. It does not record envelope recipient addresses, on the theory that they are redundant: you received the mail, so you must have been one of the envelope recipients. Note that, if the header doesn't have any recipient addresses, sendmail will move envelope recipient addresses back into the header. This situation occurs if all addresses were originally listed as Bcc, since Bcc is automatically removed. When sendmail sees this, it creates a new Apparently-To header field with the envelope recipient addresses. This has the strange effect that each blind-carbon-copy recipient will see a list of all recipients on the same machine. When a message is stored in mbox format, the envelope sender is recorded at the top of the message as a UUCP-style From (no colon) line. Note that this line is less reliable than the Return-Path line added by qmail-local or sendmail. SEE ALSO
qmail-header(5), qmail-local(8), qmail-inject(8) envelopes(5)

Featured Tech Videos

All times are GMT -4. The time now is 11:05 PM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy